More robuust ness.

This commit is contained in:
2025-11-24 01:30:16 +01:00
parent a1eb00caff
commit 0db921cfa3
5 changed files with 9 additions and 20 deletions
+2 -1
View File
@@ -47,8 +47,9 @@ int main() {
pos = ftell(file);
tc.assertEqual(pos, 10, "fseek(SEEK_END, 0) moves to end of file");
char* read_attempt = fgets(file, 10);
int eof = feof(file);
tc.assertTrue(eof, "feof() returns true at end of file");
tc.assertTrue(eof, "feof() returns true after read attempt at EOF");
fclose(file);
+1 -1
View File
@@ -48,7 +48,7 @@ int main() {
printf("\n=== Testing replace ===\n");
tc.assertStringEqual(replace("hello world", "world", "there"), "hello there", "replace('hello world', 'world', 'there')");
tc.assertStringEqual(replace("aaa", "a", "b"), "baa", "replace('aaa', 'a', 'b') replaces first");
tc.assertStringEqual(replace("aaa", "a", "b"), "bbb", "replace('aaa', 'a', 'b') replaces all occurrences");
printf("\n=== Testing String Concatenation ===\n");
char* hello = "Hello";