mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Move syntax tests to a dedicated crate
* test_fmt moves out of fmt crate * test_parse _mostly_ moves out of parse crate and into `test_snapshots.rs` (some simple tests remain) * now there's only two fuzz targets, fuzz_expr and fuzz_module, that cover both parsing and formatting * added a system to auto-add new snapshot entries for new test files * took some commented-out tests in `test_parse` and converted them to snapshot tests * moved test_fmt's verification of formatting consistency into test_snapshots * fixed a huge derp on my part where the fmt fuzzer in #4758 was completely useless (broken by refactoring just prior to submitting the PR) * fixed a formatting bug found by fuzzing (bound_variable.expr.roc) - that I missed earlier due to ^^^ that derp * no longer have roc_test_utils as a dependency in fmt - which was causing problems for the wasm build
This commit is contained in:
parent
f0b3c3eb08
commit
bfeddc470a
701 changed files with 1929 additions and 1516 deletions
|
@ -1 +0,0 @@
|
|||
Expr(Ability(DemandColon(@15), @7), @0)
|
|
@ -1,4 +0,0 @@
|
|||
MEq has
|
||||
eq b c : a, a -> U64 | a has MEq
|
||||
|
||||
1
|
|
@ -1 +0,0 @@
|
|||
Expr(Ability(DemandAlignment(4, @49), @40), @0)
|
|
@ -1,5 +0,0 @@
|
|||
MEq has
|
||||
eq : a, a -> U64 | a has MEq
|
||||
neq : a, a -> U64 | a has MEq
|
||||
|
||||
1
|
|
@ -1 +0,0 @@
|
|||
Expr(Ability(DemandAlignment(-1, @8), @7), @0)
|
|
@ -1,4 +0,0 @@
|
|||
MEq has
|
||||
eq : a, a -> U64 | a has MEq
|
||||
|
||||
1
|
|
@ -1 +0,0 @@
|
|||
Expr(Ability(DemandName(@12), @7), @0)
|
|
@ -1,4 +0,0 @@
|
|||
MEq has
|
||||
123
|
||||
|
||||
1
|
|
@ -1 +0,0 @@
|
|||
Expr(InParens(End(@3), @0), @0)
|
|
@ -1,2 +0,0 @@
|
|||
(@,B
|
||||
.e:
|
|
@ -1 +0,0 @@
|
|||
Expr(Space(HasTab, @17), @0)
|
|
@ -1,2 +0,0 @@
|
|||
# comment with a
|
||||
4
|
|
@ -1 +0,0 @@
|
|||
Expr(DefMissingFinalExpr2(Start(@11), @11), @0)
|
|
@ -1 +0,0 @@
|
|||
f : Foo.foo
|
|
@ -1 +0,0 @@
|
|||
Expr(BadOperator("++", @14), @0)
|
|
@ -1,2 +0,0 @@
|
|||
main =
|
||||
[] ++ []
|
|
@ -1 +0,0 @@
|
|||
Expr(ElmStyleFunction(@2-5, @6), @0)
|
|
@ -1 +0,0 @@
|
|||
f x y = x
|
|
@ -1 +0,0 @@
|
|||
Expr(When(Pattern(Start(@28), @28), @0), @0)
|
|
@ -1,6 +0,0 @@
|
|||
when Just 4 is
|
||||
Just 4 | ->
|
||||
4
|
||||
|
||||
_ ->
|
||||
2
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TInlineAlias(ArgumentNotLowercase(@50), @51), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : List elem -> [Nil, Cons elem a] as LinkedList U
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TInlineAlias(NotAnAlias(@39), @40), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : List elem -> [Nil, Cons elem a] as a
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TInlineAlias(Qualified(@39), @58), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : List elem -> [Nil, Cons elem a] as Module.LinkedList a
|
|
@ -1 +0,0 @@
|
|||
Expr(Pattern(NotAPattern(@3), @3), @0)
|
|
@ -1 +0,0 @@
|
|||
.e,
|
|
@ -1 +0,0 @@
|
|||
Expr(Start(@0), @0)
|
|
@ -1 +0,0 @@
|
|||
f <- Foo.foo
|
|
@ -1 +0,0 @@
|
|||
Expr(When(IfGuard(Start(@28), @27), @0), @0)
|
|
@ -1,6 +0,0 @@
|
|||
when Just 4 is
|
||||
Just if ->
|
||||
4
|
||||
|
||||
_ ->
|
||||
2
|
|
@ -1 +0,0 @@
|
|||
Expr(If(Else(@16), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
if 5 == 5 then 2
|
|
@ -1 +0,0 @@
|
|||
Expr(If(IndentThenToken(@17), @8), @0)
|
|
@ -1,5 +0,0 @@
|
|||
x =
|
||||
if 5 == 5
|
||||
then 2 else 3
|
||||
|
||||
x
|
|
@ -1 +0,0 @@
|
|||
SourceError { problem: Imports(ListEnd(@87), @65), bytes: [97, 112, 112, 32, 34, 116, 101, 115, 116, 45, 109, 105, 115, 115, 105, 110, 103, 45, 99, 111, 109, 109, 97, 34, 10, 32, 32, 32, 32, 112, 97, 99, 107, 97, 103, 101, 115, 32, 123, 32, 112, 102, 58, 32, 34, 112, 108, 97, 116, 102, 111, 114, 109, 47, 109, 97, 105, 110, 46, 114, 111, 99, 34, 32, 125, 10, 32, 32, 32, 32, 105, 109, 112, 111, 114, 116, 115, 32, 91, 112, 102, 46, 84, 97, 115, 107, 32, 66, 97, 115, 101, 54, 52, 93, 10, 32, 32, 32, 32, 112, 114, 111, 118, 105, 100, 101, 115, 32, 91, 109, 97, 105, 110, 44, 32, 64, 70, 111, 111, 93, 32, 116, 111, 32, 112, 102] }
|
|
@ -1,4 +0,0 @@
|
|||
app "test-missing-comma"
|
||||
packages { pf: "platform/main.roc" }
|
||||
imports [pf.Task Base64]
|
||||
provides [main, @Foo] to pf
|
|
@ -1 +0,0 @@
|
|||
Expr(BadOperator(":", @21), @0)
|
|
@ -1,4 +0,0 @@
|
|||
main =
|
||||
(\x -> x) : I64
|
||||
|
||||
3
|
|
@ -1 +0,0 @@
|
|||
Expr(BadOperator("**", @13), @0)
|
|
@ -1,2 +0,0 @@
|
|||
main =
|
||||
5 ** 3
|
|
@ -1 +0,0 @@
|
|||
Expr(Closure(Arg(@3), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
\a,,b -> 1
|
|
@ -1 +0,0 @@
|
|||
Expr(Closure(Arg(@1), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
\,x -> 1
|
|
@ -1 +0,0 @@
|
|||
Expr(Closure(Arg(@1), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
\,b -> 1
|
|
@ -1 +0,0 @@
|
|||
Expr(Closure(IndentBody(@5), @0), @0)
|
|
@ -1,2 +0,0 @@
|
|||
\x ->
|
||||
1
|
|
@ -1 +0,0 @@
|
|||
Expr(List(End(@7), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
[1, 2, , 3]
|
|
@ -1 +0,0 @@
|
|||
Expr(When(Pattern(List(End(@22), @15), @15), @0), @0)
|
|
@ -1,2 +0,0 @@
|
|||
when [] is
|
||||
[1, 2, -> ""
|
|
@ -1 +0,0 @@
|
|||
Expr(When(Pattern(List(End(@22), @15), @15), @0), @0)
|
|
@ -1,3 +0,0 @@
|
|||
when [] is
|
||||
[1, 2,
|
||||
3] -> ""
|
|
@ -1 +0,0 @@
|
|||
Expr(When(Pattern(List(Rest(@16), @15), @15), @0), @0)
|
|
@ -1,2 +0,0 @@
|
|||
when [] is
|
||||
[...] -> ""
|
|
@ -1 +0,0 @@
|
|||
Expr(List(End(@6), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
[1, 2,
|
|
@ -1 +0,0 @@
|
|||
Expr(Str(EndlessMulti(@3), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
"""there is no end
|
|
@ -1 +0,0 @@
|
|||
Expr(When(Arrow(@24), @0), @0)
|
|
@ -1,6 +0,0 @@
|
|||
when Just 4 is
|
||||
Just when ->
|
||||
4
|
||||
|
||||
_ ->
|
||||
2
|
|
@ -1 +0,0 @@
|
|||
Expr(Closure(Pattern(PInParens(End(@4), @1), @1), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
\( a
|
|
@ -1 +0,0 @@
|
|||
Expr(Closure(Pattern(PInParens(End(@5), @1), @1), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
\( a,
|
|
@ -1 +0,0 @@
|
|||
Expr(Closure(Pattern(PInParens(End(@2), @1), @1), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
Expr(Closure(Pattern(PInParens(End(@4), @1), @1), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
\( a
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TRecord(End(@13), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : { a: Int,
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TRecord(Field(@6), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : { if : I64 }
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TRecord(End(@11), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : { foo bar }
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TRecord(End(@5), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : {
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TRecord(IndentEnd(@5), @4), @4), @0)
|
|
@ -1,2 +0,0 @@
|
|||
f : {
|
||||
foo : I64,
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TRecord(Space(HasTab, @10), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : { foo }
|
|
@ -1 +0,0 @@
|
|||
Expr(Str(EndlessSingle(@1), @0), @0)
|
|
@ -1 +0,0 @@
|
|||
"there is no end
|
|
@ -1 +0,0 @@
|
|||
SourceError { problem: Space(HasMisplacedCarriageReturn, @1), bytes: [35, 13, 12, 9, 65] }
|
|
@ -1 +0,0 @@
|
|||
#
A
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TTagUnion(End(@9), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : [Yes,
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TTagUnion(End(@5), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : [lowercase]
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TTagUnion(End(@5), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : [
|
|
@ -1 +0,0 @@
|
|||
Expr(Type(TTagUnion(End(@11), @4), @4), @0)
|
|
@ -1 +0,0 @@
|
|||
f : [Good, bad]
|
|
@ -1 +0,0 @@
|
|||
Expr(TrailingOperator(@2), @0)
|
|
@ -1 +0,0 @@
|
|||
J-
|
|
@ -1 +0,0 @@
|
|||
Expr(BadOperator("::", @2), @0)
|
|
@ -1,4 +0,0 @@
|
|||
f :: I64
|
||||
f = 42
|
||||
|
||||
f
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue