Skip to content

Commit

Permalink
Update normalization tests (#415)
Browse files Browse the repository at this point in the history
Fixes #413

This updates the normalization tests so that the `*B.dhall` files match the
output of the Haskell implementation.

In some cases this just changes the format of the file, but in other cases
this detects a case where the `*B.dhall` file was not in normal form.
  • Loading branch information
Gabriella439 committed Mar 12, 2019
1 parent b583925 commit 12a65f1
Show file tree
Hide file tree
Showing 18 changed files with 225 additions and 177 deletions.
8 changes: 7 additions & 1 deletion tests/normalization/success/multiline/escapeB.dhall
@@ -1 +1,7 @@
"\${\n''\n\$\n\"\n\\\n"
''
''${
'''
$
"
\
''
5 changes: 4 additions & 1 deletion tests/normalization/success/multiline/hangingIndentB.dhall
@@ -1 +1,4 @@
"foo\nbar\n"
''
foo
bar
''
5 changes: 4 additions & 1 deletion tests/normalization/success/multiline/interiorIndentB.dhall
@@ -1 +1,4 @@
" foo\n bar\n"
''
foo
bar
''
5 changes: 4 additions & 1 deletion tests/normalization/success/multiline/interpolationB.dhall
@@ -1 +1,4 @@
"${Natural/show 1} foo\n bar\n"
''
1 foo
bar
''
5 changes: 4 additions & 1 deletion tests/normalization/success/multiline/preserveCommentB.dhall
@@ -1 +1,4 @@
"-- Hello\n{- world -}\n"
''
-- Hello
{- world -}
''
4 changes: 3 additions & 1 deletion tests/normalization/success/multiline/twoLinesB.dhall
@@ -1 +1,3 @@
"foo\nbar"
''
foo
bar''
5 changes: 4 additions & 1 deletion tests/normalization/success/prelude/Natural/fold/2B.dhall
@@ -1 +1,4 @@
λ(natural : Type) λ(succ : natural natural) λ(zero : natural) succ (succ (succ zero))
λ(natural : Type)
λ(succ : natural natural)
λ(zero : natural)
succ (succ (succ zero))
@@ -1 +1 @@
[ 1 ] : List Natural
[ 1 ]
282 changes: 144 additions & 138 deletions tests/normalization/success/remoteSystemsB.dhall

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions tests/normalization/success/simple/doubleShowB.dhall
@@ -1,6 +1,11 @@
{ example0 = "-0.42"
, example1 = "13.37"
, example2 = "NaN"
, example3 = "Infinity"
, example4 = "-Infinity"
{ example0 =
"-0.42"
, example1 =
"13.37"
, example2 =
"NaN"
, example3 =
"Infinity"
, example4 =
"-Infinity"
}
4 changes: 2 additions & 2 deletions tests/normalization/success/simple/listBuildB.dhall
@@ -1,7 +1,7 @@
{ example0 =
[ True, False ] : List Bool
[ True, False ]
, example1 =
[ True, False ] : List Bool
[ True, False ]
, example2 =
λ(id : (a : Type) a a) id (List Bool) [ True, False ]
}
8 changes: 4 additions & 4 deletions tests/normalization/success/simple/optionalBuildB.dhall
@@ -1,9 +1,9 @@
{ example0 =
[ 1 ] : Optional Natural
Some 1
, example1 =
[ +1 ] : Optional Integer
Some +1
, example2 =
λ(id : (a : Type) a a) id (Optional Bool) ([ True ] : Optional Bool)
λ(id : (a : Type) a a) id (Optional Bool) (Some True)
, example3 =
λ(a : Type) λ(x : a) [ x ] : Optional a
λ(a : Type) λ(x : a) Some x
}
@@ -1 +1 @@
[ "foo" ] : Optional Text
Some "foo"
15 changes: 10 additions & 5 deletions tests/normalization/success/simplifications/andB.dhall
@@ -1,6 +1,11 @@
{ example0 = λ(x : Bool) x
, example1 = λ(x : Bool) x
, example2 = λ(x : Bool) False
, example3 = λ(x : Bool) False
, example4 = λ(x : Bool) x
{ example0 =
λ(x : Bool) x
, example1 =
λ(x : Bool) x
, example2 =
λ(x : Bool) False
, example3 =
λ(x : Bool) False
, example4 =
λ(x : Bool) x
}
9 changes: 6 additions & 3 deletions tests/normalization/success/simplifications/eqB.dhall
@@ -1,4 +1,7 @@
{ example0 = λ(x : Bool) x
, example1 = λ(x : Bool) x
, example2 = λ(x : Bool) True
{ example0 =
λ(x : Bool) x
, example1 =
λ(x : Bool) x
, example2 =
λ(x : Bool) True
}
@@ -1,3 +1 @@
{ example0 = λ(x : Bool) x
, example1 = λ(x : Bool) λ(y : Text) y
}
{ example0 = λ(x : Bool) x, example1 = λ(x : Bool) λ(y : Text) y }
9 changes: 6 additions & 3 deletions tests/normalization/success/simplifications/neB.dhall
@@ -1,4 +1,7 @@
{ example0 = λ(x : Bool) x
, example1 = λ(x : Bool) x
, example2 = λ(x : Bool) False
{ example0 =
λ(x : Bool) x
, example1 =
λ(x : Bool) x
, example2 =
λ(x : Bool) False
}
15 changes: 10 additions & 5 deletions tests/normalization/success/simplifications/orB.dhall
@@ -1,6 +1,11 @@
{ example0 = λ(x : Bool) True
, example1 = λ(x : Bool) True
, example2 = λ(x : Bool) x
, example3 = λ(x : Bool) x
, example4 = λ(x : Bool) x
{ example0 =
λ(x : Bool) True
, example1 =
λ(x : Bool) True
, example2 =
λ(x : Bool) x
, example3 =
λ(x : Bool) x
, example4 =
λ(x : Bool) x
}

0 comments on commit 12a65f1

Please sign in to comment.