File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,29 @@ int main() {
27
27
#ifndef _TESTING
28
28
std::getline (std::cin, code);
29
29
#else
30
- code = " let var t: int in t := t + 1" ;
31
- // code = "if(true*true) then x:=x+1 else z:=z+2";
30
+ // syntax issue - missing in keyword
31
+ // code = "let var t: int t := t + t";
32
+
33
+ // test string <-> int incompatibility
34
+ // code = "let var t: int in t := t + abc";
35
+
36
+ // test int <-> int incompatibility, assignment, let command
37
+ // code = "let var t: int in t := t + 111";
38
+
39
+ // shows breaking of language example if statement requires Commands (i.e. assiignemnt, ifstatement or let)
40
+ // code = "if(true+true) then x+x else z+z";
41
+
42
+ // shows nested commands
43
+ // code = "if(true+true) then let var e: int in e:=e+1 else let var z: int in z:=z+2";
44
+
45
+ // shows nested let commands with duplicate variables
46
+ // code = "let var e: int in let var e: int in e:=e+e";
47
+
48
+ // shows incompatible data types
49
+ // code = "if(true+true) then x:=x+1 else z:=z+2";
50
+
51
+ // shows undeclared variable
52
+ // code = "if(true+true) then x:=z+z else z:=z+2";
32
53
#endif
33
54
}
34
55
You can’t perform that action at this time.
0 commit comments