mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Migrate more tests
This commit is contained in:
parent
9775d4f0ca
commit
7c14b78e5d
14 changed files with 137 additions and 215 deletions
13
crates/compiler/uitest/tests/solve/check_phantom_type.txt
Normal file
13
crates/compiler/uitest/tests/solve/check_phantom_type.txt
Normal 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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,7 @@
|
|||
app "test" provides [f] to "./platform"
|
||||
|
||||
{a} : {a: _}
|
||||
{a} = {a: ""}
|
||||
|
||||
f = a
|
||||
# ^ Str
|
|
@ -0,0 +1,5 @@
|
|||
app "test" provides [a] to "./platform"
|
||||
|
||||
a : {a: _}
|
||||
a = {a: ""}
|
||||
#^{-1} { a : Str }
|
|
@ -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
|
|
@ -0,0 +1,8 @@
|
|||
app "test" provides [main] to "./platform"
|
||||
|
||||
entry =
|
||||
A := U8
|
||||
List.map [1, 2, 3] @A
|
||||
|
||||
main = entry
|
||||
# ^^^^^ List A
|
|
@ -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)
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue