From af0e0da6b735aff4e1c952c8cf2b7ccf2d7dae90 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Thu, 2 Jun 2022 09:37:55 -0700 Subject: [PATCH] add tests for known bugs --- .../definition/use_decl_variable_as_assign_fail.leo | 10 ++++++++++ tests/compiler/function/no_return_fail.leo | 6 ++++++ .../compiler/statements/non_existant_var_exp_fail.leo | 10 ++++++++++ .../compiler/statements/non_existant_vars_mul_fail.leo | 10 ++++++++++ 4 files changed, 36 insertions(+) create mode 100644 tests/compiler/definition/use_decl_variable_as_assign_fail.leo create mode 100644 tests/compiler/function/no_return_fail.leo create mode 100644 tests/compiler/statements/non_existant_var_exp_fail.leo create mode 100644 tests/compiler/statements/non_existant_vars_mul_fail.leo diff --git a/tests/compiler/definition/use_decl_variable_as_assign_fail.leo b/tests/compiler/definition/use_decl_variable_as_assign_fail.leo new file mode 100644 index 0000000000..79d1af8554 --- /dev/null +++ b/tests/compiler/definition/use_decl_variable_as_assign_fail.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Fail +input_file: inputs/dummy.in +*/ + +function main(y: bool) -> bool { + let b: u8 = b; + return y == true; +} \ No newline at end of file diff --git a/tests/compiler/function/no_return_fail.leo b/tests/compiler/function/no_return_fail.leo new file mode 100644 index 0000000000..eacda3f528 --- /dev/null +++ b/tests/compiler/function/no_return_fail.leo @@ -0,0 +1,6 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() -> u8 {} \ No newline at end of file diff --git a/tests/compiler/statements/non_existant_var_exp_fail.leo b/tests/compiler/statements/non_existant_var_exp_fail.leo new file mode 100644 index 0000000000..6ac1d5ff33 --- /dev/null +++ b/tests/compiler/statements/non_existant_var_exp_fail.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Fail +input_file: inputs/dummy.in +*/ + +function main(k: bool) -> bool { + let b: u8 = 1u8**z; + return k == true; +} \ No newline at end of file diff --git a/tests/compiler/statements/non_existant_vars_mul_fail.leo b/tests/compiler/statements/non_existant_vars_mul_fail.leo new file mode 100644 index 0000000000..9b44527dde --- /dev/null +++ b/tests/compiler/statements/non_existant_vars_mul_fail.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Fail +input_file: inputs/dummy.in +*/ + +function main(k: bool) -> bool { + let b: u8 = x*z; + return k == true; +} \ No newline at end of file