added testing suite for binary and unary operations typechecking
This commit is contained in:
6
tests/sprint3/test/sp3_boolean_binary_op_typecheck.alpha
Normal file
6
tests/sprint3/test/sp3_boolean_binary_op_typecheck.alpha
Normal file
@ -0,0 +1,6 @@
|
||||
entry(arg) := {
|
||||
[integer:x; address: arr; address: arr2; Boolean : b2; Boolean : b1]
|
||||
b2 := 3 < x;
|
||||
b1 := arr = 2;
|
||||
b1 := 6<7 & arr2=7;
|
||||
}
|
5
tests/sprint3/test/sp3_boolean_unary_op_typecheck.alpha
Normal file
5
tests/sprint3/test/sp3_boolean_unary_op_typecheck.alpha
Normal file
@ -0,0 +1,5 @@
|
||||
entry(arg) := {
|
||||
[integer:x; address: arr; address: arr2; Boolean : b2; Boolean : b1]
|
||||
b2 := !(3 < 2);
|
||||
b1 := !5;
|
||||
}
|
9
tests/sprint3/test/sp3_integer_binary_op_typecheck.alpha
Normal file
9
tests/sprint3/test/sp3_integer_binary_op_typecheck.alpha
Normal file
@ -0,0 +1,9 @@
|
||||
entry(arg) := {
|
||||
[integer:x; address: arr; address: arr2; Boolean : b2; Boolean : b1; character : a]
|
||||
x := 3 + 2 * 8;
|
||||
x := 3 - 2 / 8;
|
||||
x := a * 2 % 8;
|
||||
b2 := 3 * 2 % 8;
|
||||
x := 3 % 2 * 8;
|
||||
x := 3 + arr - 8;
|
||||
}
|
6
tests/sprint3/test/sp3_integer_unary_op_typecheck.alpha
Normal file
6
tests/sprint3/test/sp3_integer_unary_op_typecheck.alpha
Normal file
@ -0,0 +1,6 @@
|
||||
entry(arg) := {
|
||||
[integer:x; address: arr; address: arr2; Boolean : b2; Boolean : b1]
|
||||
x := -8;
|
||||
x := -b1;
|
||||
b2 := -x;
|
||||
}
|
Reference in New Issue
Block a user