mirror of
https://github.com/anoma/juvix.git
synced 2025-01-05 22:46:08 +03:00
parent
755f02ab4c
commit
b4347bdd23
@ -1 +1 @@
|
||||
Subproject commit 149dc68479c794d645ca6abadc3aa948d43dd9da
|
||||
Subproject commit 034c5236afb1c7b9dc0aa6754515001f5694cc7e
|
@ -344,5 +344,10 @@ tests =
|
||||
"Test057: Case folding"
|
||||
$(mkRelDir ".")
|
||||
$(mkRelFile "test057.juvix")
|
||||
$(mkRelFile "out/test057.out")
|
||||
$(mkRelFile "out/test057.out"),
|
||||
posTest
|
||||
"Test058: Ranges"
|
||||
$(mkRelDir ".")
|
||||
$(mkRelFile "test058.juvix")
|
||||
$(mkRelFile "out/test058.out")
|
||||
]
|
||||
|
1
tests/Compilation/positive/out/test058.out
Normal file
1
tests/Compilation/positive/out/test058.out
Normal file
@ -0,0 +1 @@
|
||||
7550
|
14
tests/Compilation/positive/test058.juvix
Normal file
14
tests/Compilation/positive/test058.juvix
Normal file
@ -0,0 +1,14 @@
|
||||
-- ranges
|
||||
module test058;
|
||||
|
||||
import Stdlib.Prelude open hiding {for};
|
||||
import Stdlib.Data.Nat.Range open;
|
||||
|
||||
sum : Nat → Nat;
|
||||
sum x := for (acc := 0) (n in 1 to x) {acc + n};
|
||||
|
||||
sum' : Nat → Nat;
|
||||
sum' x := for (acc := 0) (n in 1 to x step 2) {acc + n};
|
||||
|
||||
main : Nat;
|
||||
main := sum 100 + sum' 100;
|
Loading…
Reference in New Issue
Block a user