[fine] More tests and also comparisons
This commit is contained in:
parent
55749af917
commit
7fb88ef199
5 changed files with 101 additions and 4 deletions
18
fine/tests/expression/comparisons.fine
Normal file
18
fine/tests/expression/comparisons.fine
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
fun is_hello(x:string) -> bool {
|
||||
x == "hello"
|
||||
}
|
||||
|
||||
fun is_23(x:f64) -> bool {
|
||||
x == 23.0
|
||||
}
|
||||
|
||||
fun is_false(x:bool) -> bool {
|
||||
x == false
|
||||
}
|
||||
|
||||
fun test() -> bool {
|
||||
is_hello("hello") and is_23(23) and is_false(false)
|
||||
}
|
||||
|
||||
// @no-errors
|
||||
// @eval: Bool(true)
|
||||
16
fine/tests/expression/worst_fib.fine
Normal file
16
fine/tests/expression/worst_fib.fine
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
fun worst_fib(n: f64) -> f64 {
|
||||
if n == 0 {
|
||||
0
|
||||
} else if n == 1 {
|
||||
1
|
||||
} else {
|
||||
worst_fib(n-2) + worst_fib(n-1)
|
||||
}
|
||||
}
|
||||
|
||||
fun test() -> f64 {
|
||||
worst_fib(10)
|
||||
}
|
||||
|
||||
// @no-errors
|
||||
// @eval: Float(55.0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue