[fine] Here are some tests
This commit is contained in:
parent
ac3c158a81
commit
3415b1a3f6
2 changed files with 18 additions and 0 deletions
6
fine/tests/expression/errors/while_not_bool.fine
Normal file
6
fine/tests/expression/errors/while_not_bool.fine
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
fun test() {
|
||||
while 12 {}
|
||||
}
|
||||
|
||||
// @expect-errors:
|
||||
// | 2:8: the condition of the while loop must produce a boolean
|
||||
12
fine/tests/expression/loops.fine
Normal file
12
fine/tests/expression/loops.fine
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fun test() -> f64 {
|
||||
let result = 1;
|
||||
let i = 0;
|
||||
while i < 10 {
|
||||
result = result * 2;
|
||||
i = i + 1;
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
// @no-errors
|
||||
// @eval: Float(1024.0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue