diff --git a/tests/01_err-syntax.test b/tests/01_err-syntax.test index fdc5b8a..2535976 100644 --- a/tests/01_err-syntax.test +++ b/tests/01_err-syntax.test @@ -1 +1,3 @@ -a = 1312; # Error on line 1 col 2: Unbound variable "a". +void main () { + a = 1312; # Error on line 2 col 6: Unbound variable "a". +} diff --git a/tests/02_int.test b/tests/02_int.test index 2d98885..6872258 100644 --- a/tests/02_int.test +++ b/tests/02_int.test @@ -1 +1,3 @@ -int a = 1312; +void main () { + int a = 1312; +} diff --git a/tests/03_bool.test b/tests/03_bool.test index dcd965f..1b6d217 100644 --- a/tests/03_bool.test +++ b/tests/03_bool.test @@ -1 +1,3 @@ -bool a = true; +void main () { + bool a = true; +} diff --git a/tests/04_err-unbound-variable.test b/tests/04_err-unbound-variable.test index 34d694b..ce01cb2 100644 --- a/tests/04_err-unbound-variable.test +++ b/tests/04_err-unbound-variable.test @@ -1 +1,3 @@ -foo = 1312; # Error on line 1 col 4: Unbound variable "foo". +void main () { + foo = 1312; # Error on line 2 col 8: Unbound variable "foo". +} diff --git a/tests/05_err-unbound-variable.test b/tests/05_err-unbound-variable.test index da088d8..d4f75bd 100644 --- a/tests/05_err-unbound-variable.test +++ b/tests/05_err-unbound-variable.test @@ -1 +1,3 @@ -int foo = bar; # Error on line 1 col 10: Unbound variable "bar". +void main () { + int foo = bar; # Error on line 2 col 14: Unbound variable "bar". +} diff --git a/tests/06_warn-unassigned-variable.test b/tests/06_warn-unassigned-variable.test index cec8784..d02b012 100644 --- a/tests/06_warn-unassigned-variable.test +++ b/tests/06_warn-unassigned-variable.test @@ -1,2 +1,4 @@ -int foo; -int bar = foo; # Warning on line 2 col 10: Unassigned variable "foo". +void main () { + int foo; + int bar = foo; # Warning on line 3 col 14: Unassigned variable "foo". +} diff --git a/tests/07_err-type-const.test b/tests/07_err-type-const.test index b7b4e11..abe44c3 100644 --- a/tests/07_err-type-const.test +++ b/tests/07_err-type-const.test @@ -1 +1,3 @@ -int foo = true; # Error on line 1 col 10: Expected int but given bool. +void main () { + int foo = true; # Error on line 2 col 14: Expected int but given bool. +} diff --git a/tests/08_err-type-variable.test b/tests/08_err-type-variable.test index b770043..ae27463 100644 --- a/tests/08_err-type-variable.test +++ b/tests/08_err-type-variable.test @@ -1,2 +1,4 @@ -int foo = 1312; -bool bar = foo; # Error on line 2 col 11: Expected bool but given int. +void main () { + int foo = 1312; + bool bar = foo; # Error on line 3 col 15: Expected bool but given int. +} diff --git a/tests/09_return.test b/tests/09_return.test index f67b971..8bc19ce 100644 --- a/tests/09_return.test +++ b/tests/09_return.test @@ -1,2 +1,5 @@ -int vie = 42; -return vie; +int main () { + int vie = 42; + + return vie; +} diff --git a/tests/10_math.test b/tests/10_math.test index cbee8d6..956c93e 100644 --- a/tests/10_math.test +++ b/tests/10_math.test @@ -1,2 +1,4 @@ -int res = 13 * 100 + 20 - 8; -res = res * 2 / 2; +void main () { + int res = 13 * 100 + 20 - 8; + res = res * 2 / 2; +}