add const test

This commit is contained in:
damirka 2021-05-06 14:52:20 +03:00
parent acf5e1dc08
commit a39197af62
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,9 @@
/*
namespace: Compile
expectation: Fail
*/
function main() {
let x = 3u8;
const y = x > 2u8? 1u8 : 2u8;
}

View File

@ -0,0 +1,5 @@
---
namespace: Compile
expectation: Fail
outputs:
- " --> /Users/dam/projects/aleo/leo/test-framework/../tests/compiler/statements/ternary_non_const_fail.leo:5:5\n |\n 5 | const y = x > 2u8? 1u8 : 2u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = failed to create const variable(s) 'y' with non constant values."