Assert formatting for parse tests

This commit is contained in:
Joshua Warner 2022-11-15 17:42:41 -05:00
parent 1efd7260de
commit d4bf946327
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
105 changed files with 495 additions and 12 deletions

View file

@ -0,0 +1,4 @@
Hash has
hash : a -> U64
1

View file

@ -0,0 +1,5 @@
Hash has
hash : a -> U64
hash2 : a -> U64
1

View file

@ -0,0 +1,3 @@
Hash has hash : a -> U64 | a has Hash
1

View file

@ -0,0 +1,5 @@
Ab1 has ab1 : a -> {} | a has Ab1
Ab2 has ab2 : a -> {} | a has Ab2
1

View file

@ -0,0 +1,4 @@
{ x, y } : Foo
{ x, y } = { x: "foo", y: 3.14 }
x

View file

@ -0,0 +1,4 @@
UserId x : [UserId I64]
(UserId x) = UserId 42
x

View file

@ -0,0 +1,4 @@
(x, y) : Foo
(x, y) = ("foo", 3.14)
x

View file

@ -0,0 +1 @@
whee 12 34

View file

@ -0,0 +1 @@
!whee 12 foo

View file

@ -0,0 +1,9 @@
## first line of docs
## second line
## third line
## fourth line
##
## sixth line after doc new line
x = 5
42

View file

@ -0,0 +1,3 @@
12
* # test!
92

View file

@ -0,0 +1,2 @@
3 # test!
+ 4

View file

@ -0,0 +1,2 @@
3 # 2 × 2
+ 4

View file

@ -0,0 +1,3 @@
(Email str) = Email "blah@example.com"
str

View file

@ -0,0 +1 @@
x == y

View file

@ -0,0 +1,4 @@
expect
1 == 1
4

View file

@ -0,0 +1,3 @@
iffy = 5
42

View file

@ -0,0 +1,2 @@
\x ->
1

View file

@ -0,0 +1,10 @@
my_list = [
0,
[
a,
b,
],
1,
]
42

View file

@ -0,0 +1,9 @@
when [] is
[] -> {}
[..] -> {}
[_, .., _, ..] -> {}
[a, b, c, d] -> {}
[a, b, ..] -> {}
[.., c, d] -> {}
[[A], [..], [a]] -> {}
[[[], []], [[], x]] -> {}

View file

@ -0,0 +1,3 @@
when x is
bar.and -> 1
_ -> 4

View file

@ -0,0 +1,3 @@
when x is
Foo.and -> 1
_ -> 4

View file

@ -0,0 +1,7 @@
# ## not docs!
## docs, but with a problem
## (namely that this is a mix of docs and regular comments)
# not docs
x = 5
42

View file

@ -0,0 +1,3 @@
x, y <- List.map2 [] []
x + y

View file

@ -0,0 +1,13 @@
a = "Hello,\n\nWorld!"
b =
"""
Hello,\n\nWorld!
"""
c =
"""
Hello,
World!
"""
42

View file

@ -0,0 +1 @@
31 * 42 + 534

View file

@ -0,0 +1,6 @@
if t1 then
1
else if t2 then
2
else
3

View file

@ -0,0 +1,7 @@
# ######
# ## not docs!
# #still not docs
# #####
x = 5
42

View file

@ -0,0 +1,37 @@
{
u8: 123u8,
u16: 123u16,
u32: 123u32,
u64: 123u64,
u128: 123u128,
i8: 123i8,
i16: 123i16,
i32: 123i32,
i64: 123i64,
i128: 123i128,
nat: 123nat,
dec: 123dec,
u8Neg: -123u8,
u16Neg: -123u16,
u32Neg: -123u32,
u64Neg: -123u64,
u128Neg: -123u128,
i8Neg: -123i8,
i16Neg: -123i16,
i32Neg: -123i32,
i64Neg: -123i64,
i128Neg: -123i128,
natNeg: -123nat,
decNeg: -123dec,
u8Bin: 0b101u8,
u16Bin: 0b101u16,
u32Bin: 0b101u32,
u64Bin: 0b101u64,
u128Bin: 0b101u128,
i8Bin: 0b101i8,
i16Bin: 0b101i16,
i32Bin: 0b101i32,
i64Bin: 0b101i64,
i128Bin: 0b101i128,
natBin: 0b101nat,
}

View file

@ -0,0 +1,4 @@
# leading comment
x <- \y -> y
x

View file

@ -0,0 +1,4 @@
# leading comment
x = 5
42

View file

@ -0,0 +1,4 @@
# leading comment
x = 5
42

View file

@ -0,0 +1,3 @@
(@Thunk it) = id (@A {})
it {}

View file

@ -0,0 +1,24 @@
A := U8 has [Eq, Hash]
A := a | a has Other
has [Eq, Hash]
A := a | a has Other
has [Eq, Hash]
A := U8 has [Eq { eq }, Hash { hash }]
A := U8 has [Eq { eq, eq1 }]
A := U8 has [Eq { eq, eq1 }, Hash]
A := U8 has [Hash, Eq { eq, eq1 }]
A := U8 has []
A := a | a has Other
has [Eq { eq }, Hash { hash }]
A := U8 has [Eq {}]
0

View file

@ -0,0 +1,2 @@
when n is
@Age -> 1

View file

@ -0,0 +1,2 @@
when n is
@Add n m -> n + m

View file

@ -0,0 +1,8 @@
x = foo
(
baz {
bar: blah,
}
)
x

View file

@ -0,0 +1,7 @@
a = [
1,
2,
3,
]
a

View file

@ -0,0 +1,5 @@
x = foo {
bar: blah,
}
x

View file

@ -0,0 +1,3 @@
Blah a b : Foo.Bar.Baz x y
42

View file

@ -0,0 +1,3 @@
foo : Foo.Bar.Baz x y as Blah a b
42

View file

@ -0,0 +1,2 @@
when Delmin (Del rx) 0 is
Delmin (Del ry) _ -> Node Black 0 Bool.false ry

View file

@ -0,0 +1 @@
1 * if Bool.true then 1 else 1

View file

@ -0,0 +1,5 @@
1
+
when Foo is
Foo -> 2
Bar -> 3

View file

@ -0,0 +1,5 @@
# leading comment
{ x, y } = 5
y = 6
42

View file

@ -0,0 +1,8 @@
f : {
getLine : Effect Str,
putLine : Str -> Effect Int,
text : Str,
value : Int *,
}
42

View file

@ -0,0 +1,3 @@
x : { init : {} -> Model, update : Model, Str -> Model, view : Model -> Str }
42

View file

@ -0,0 +1 @@
{ x: if Bool.true then 1 else 2, y: 3 }

View file

@ -0,0 +1,5 @@
# leading comment
x <- \y -> y
z <- {}
x

View file

@ -0,0 +1,3 @@
when x is
"" -> 1
"mise" -> 2

View file

@ -0,0 +1,5 @@
# leading comment
x = 5
y = 6
42

View file

@ -0,0 +1,3 @@
doStuff : UserId -> Task Str _
42

View file

@ -0,0 +1,4 @@
# leading comment
_ <- \y -> y
4

View file

@ -0,0 +1,7 @@
(Pair x _) = Pair 0 1
(Pair _ y) = Pair 0 1
(Pair _ _) = Pair 0 1
_ = Pair 0 1
(Pair (Pair x _) (Pair _ y)) = Pair (Pair 0 1) (Pair 2 3)
0

View file

@ -0,0 +1,9 @@
when x is
_ ->
1
_ ->
2
Ok ->
3

View file

@ -0,0 +1,4 @@
x = when n is
0 -> 0
42

View file

@ -0,0 +1,4 @@
func = \x -> when n is
0 -> 0
42

View file

@ -0,0 +1,4 @@
func = \x -> when n is
0 -> 0
42

View file

@ -0,0 +1,3 @@
when x is
Ok ->
3

View file

@ -0,0 +1,2 @@
when x is
Ok -> 3

View file

@ -0,0 +1,7 @@
when x is
"blah" | "blop" -> 1
"foo"
| "bar"
| "baz" -> 2
"stuff" -> 4

View file

@ -0,0 +1,6 @@
when x is
1 ->
Num.neg
2
_ -> 4

View file

@ -0,0 +1,3 @@
when x is
1 -> 2
-3 -> 4

View file

@ -0,0 +1,3 @@
when x is
1 -> 2
3 -> 4

View file

@ -0,0 +1,3 @@
when x is
{ y } -> 2
{ z, w } -> 4

View file

@ -0,0 +1,3 @@
when { foo: (1, 2) } is
{ foo: (1, x) } -> x
{ foo: (_, b) } -> 3 + b

View file

@ -0,0 +1,3 @@
when (1, 2) is
(1, x) -> x
(_, b) -> 3 + b

View file

@ -0,0 +1,3 @@
f : a -> (b -> c) | a has A
f

View file

@ -0,0 +1,7 @@
f : a -> b | a has Hash & Eq, b has Eq & Hash & Display
f :
a
-> b | a has Hash & Eq, b has Hash & Display & Eq
f

View file

@ -0,0 +1,3 @@
f : a -> (b -> c) | a has A, b has Eq, c has Ord
f

Some files were not shown because too many files have changed in this diff Show more