Skip to content

Commit

Permalink
tests: fix parsing of karlheinz.brat; extend let.brat (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc authored Dec 23, 2024
1 parent f0c22a4 commit bb0f617
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion brat/examples/karlheinz.brat
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ answer = energy(results)
evaluate(obs :: Observable
,q :: Quantity
,a :: Ansatz
,rs :: List Real
,rs :: List(Real)
) -> Real
evaluate = ?eval

Expand Down
10 changes: 10 additions & 0 deletions brat/examples/let.brat
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ nums' = let xs = map(inc, [0,2,3]) in xs

nums'' :: List(Int)
nums'' = let i2 = {inc; inc} in map(i2, xs)

dyad :: Int, Bool
dyad = 42, true

bind2 :: Bool
bind2 = let i, b = dyad in b

-- It shouldn't matter if we put brackets in the binding sites
bind2' :: Bool
bind2' = let (i, b) = dyad in b
1 change: 1 addition & 0 deletions brat/test/Test/Checking.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Test.Tasty.HUnit
import Test.Tasty.Silver

expectedCheckingFails = map ("examples" </>) ["nested-abstractors.brat"
,"karlheinz.brat"
,"karlheinz_alias.brat"
,"hea.brat"
]
Expand Down
4 changes: 1 addition & 3 deletions brat/test/Test/Parsing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ testParse file = testCase (show file) $ do
Left err -> assertFailure (show err)
Right _ -> return () -- OK

expectedParsingFails = map ("examples" </>) [
"karlheinz.brat",
"thin.brat"]
expectedParsingFails = ["examples" </> "thin.brat"]

parseXF = expectFailForPaths expectedParsingFails testParse

Expand Down

0 comments on commit bb0f617

Please sign in to comment.