Migrate more tests

This commit is contained in:
Ayaz Hafiz 2023-04-12 18:08:05 -05:00
parent 9775d4f0ca
commit 7c14b78e5d
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
14 changed files with 137 additions and 215 deletions

View file

@ -0,0 +1,13 @@
app "test" provides [main] to "./platform"
entry =
F a b := b
foo : F Str Str -> F U8 Str
x : F Str Str
foo x
main = entry
# ^^^^^ F U8 Str

View file

@ -0,0 +1,12 @@
app "test" provides [main] to "./platform"
Parser a : List U8 -> List [Pair a (List U8)]
any: Parser U8
any = \inp ->
when List.first inp is
Ok u -> [Pair u (List.drop inp 1)]
_ -> []
main = any
# ^^^ Parser U8

View file

@ -0,0 +1,12 @@
app "test" provides [main] to "./platform"
entry =
F a b := b
foo : _ -> F U8 Str
foo = \it -> it
foo
main = entry
# ^^^^^ F U8 Str -[[foo(3)]]-> F U8 Str

View file

@ -0,0 +1,11 @@
app "test" provides [main] to "./platform"
entry =
F a b := b
foo = \@F {} -> @F ""
foo
main = entry
# ^^^^^ F w_a {}w_b -[[foo(3)]]-> F w_c Str

View file

@ -0,0 +1,7 @@
app "test" provides [f] to "./platform"
{a} : {a: _}
{a} = {a: ""}
f = a
# ^ Str

View file

@ -0,0 +1,5 @@
app "test" provides [a] to "./platform"
a : {a: _}
a = {a: ""}
#^{-1} { a : Str }

View file

@ -0,0 +1,11 @@
app "test" provides [main] to "./platform"
entry =
f : _ -> Str
f = \s -> g s
g = \s -> if Bool.true then s else f s
g
main = entry
# ^^^^^ Str -[[g(3)]]-> Str

View file

@ -0,0 +1,8 @@
app "test" provides [main] to "./platform"
entry =
A := U8
List.map [1, 2, 3] @A
main = entry
# ^^^^^ List A

View file

@ -0,0 +1,8 @@
app "test" provides [main] to "./platform"
entry =
A a := a
List.map [1u8, 2u8, 3u8] @A
main = entry
# ^^^^^ List (A U8)

View file

@ -0,0 +1,12 @@
app "test" provides [main] to "./platform"
entry =
Rose a : [Rose (Result (List (Rose a)) I64)]
x : Rose I64
x = Rose (Ok [])
x
main = entry
# ^^^^^ Rose I64

View file

@ -0,0 +1,10 @@
app "test" provides [main] to "./platform"
entry =
f : _ -> _
f = \_ -> if Bool.false then "" else f ""
f
main = entry
# ^^^^^ Str -[[f(2)]]-> Str

View file

@ -0,0 +1,14 @@
app "test" provides [main] to "./platform"
entry =
OList := [Nil, Cons {} OList]
lst : [Cons {} OList]
olist : OList
olist = (\l -> @OList l) lst
olist
main = entry
# ^^^^^ OList

View file

@ -0,0 +1,14 @@
app "test" provides [main] to "./platform"
entry =
OList := [Nil, Cons {} OList]
lst : [Cons {} OList]
olist : OList
olist = @OList lst
olist
main = entry
# ^^^^^ OList