From 06087b10ec7a897ad48db83f7f33a8fc11fa9341 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Wed, 28 Aug 2019 17:28:55 -0400 Subject: Added break statement to templates Added a break statement that can break out of loops, also added some tests to test the functionality of the same. --- t/test_2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/test_2.c b/t/test_2.c index e11fcdc..f099460 100644 --- a/t/test_2.c +++ b/t/test_2.c @@ -21,7 +21,7 @@ char c_3_3[] = "Check variable scope after breaking loop one four five eight nin char c_3_4[] = "Check variable scope after breaking loop one four five eight and a half nine.";//loop1 does not have test1, loop1 has loop2, after is "and a half " #define log(x) printf(x) -#define check(n,n2,a,b) if(strcmp(a,b) != 0){fprintf(stderr, "Error in test 2.%d.%d\n",n,n2);printf("Result should have been '%s'\n was '%s'\n", b, a); if(t->error) printf(TMPL_err(t, NULL)); return -1;} +#define check(n,n2,a,b) if(strcmp(a,b) != 0){fprintf(stderr, "Error in test 2.%d.%d\n",n,n2);printf("Result should have been '%s'\n was '%s'\n", b, a); if(t->error) printf(TMPL_err(t, NULL)); return -1;}else{printf("\n\n##########\n##Test %d.%d passed\n##########\n\n\n",n,n2);} int main(){ log("Running tests2\n"); -- cgit v1.2.3-70-g09d2