Skip to content

Commit

Permalink
implement e2etest
Browse files Browse the repository at this point in the history
  • Loading branch information
kumachan-mis committed Oct 9, 2023
1 parent b9da999 commit 5e2cfd8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
17 changes: 17 additions & 0 deletions test-fixtures/for/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
0
1
2
3
4

2
4
8
16
32
64
128
256
512
1024
2048
22 changes: 22 additions & 0 deletions test-fixtures/for/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
void put_int(int x);
void put_str(char* str);
void put_blank_line(void);

int main(void) {
for (; 0;) {
put_str("ERROR: for loop should not be executed");
}

for (int i = 0; i < 5; i++) {
put_int(i);
}
put_blank_line();

int i = 0, y = 0, z = 1;
for (i = 0; i < 11; i++) {
z = 2 * z;
put_int(z);
}

return 0;
}
4 changes: 1 addition & 3 deletions test-fixtures/x-mergesort/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ int main(void) {
int array[10] = {13, 3, 9, 8, 5, 1, 4, 11, 2, 7};
merge_sort(array, 0, 9);

int i = 0;
while (i < 10) {
for (int i = 0; i < 10; ++i) {
put_int(array[i]);
i++;
}

return 0;
Expand Down

0 comments on commit 5e2cfd8

Please sign in to comment.