Untitled
unknown
plain_text
3 years ago
1.0 kB
8
Indexable
int main() {
//Special test case
str_t orig = create("horse");
str_t targ = create("horse");
str_t rpl = create("horse");
printf("%s\n", orig->strt_content);
edit(targ, rpl, orig);
printf("%s\n", orig->strt_content); // prints "the quick brown cat jumps over the lazy dog"
//Test case 1
str_t orig1 = create("aaaaa");
str_t targ1 = create("aa");
str_t rpl1= create("bbb");
printf("Test1 Before:%s\n", orig1->strt_content);
edit(targ1, rpl1, orig1);
printf("Test 1 After:%s\n", orig1->strt_content); // prints "the quick brown cat jumps over the lazy dog"
//Test case 2
str_t orig2 = create("hypermobility");
str_t targ2 = create("hyper");
str_t rpl2= create("");
printf("Test2 Before:%s\n", orig2->strt_content);
edit(targ2, rpl2, orig2);
printf("Test2 After:%s\n", orig2->strt_content); // prints "the quick brown cat jumps over the lazy dog"
printf("Length:%d\n", orig2->strt_length);
return 0;
}
Editor is loading...