Skip to content

Commit

Permalink
Add regression test for issue #146
Browse files Browse the repository at this point in the history
  • Loading branch information
gdetrez committed Jun 24, 2015
1 parent 698e12d commit 3d0dcde
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 3 deletions.
1 change: 1 addition & 0 deletions testing/regression-tests/comments/good01.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo // bar
11 changes: 11 additions & 0 deletions testing/regression-tests/comments/good01.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
good01.in

Parse Successful!

[Abstract Syntax]

Foo

[Linearized tree]

foo
1 change: 1 addition & 0 deletions testing/regression-tests/comments/good02.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo " bar
11 changes: 11 additions & 0 deletions testing/regression-tests/comments/good02.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
good01.in

Parse Successful!

[Abstract Syntax]

Foo

[Linearized tree]

foo
1 change: 1 addition & 0 deletions testing/regression-tests/comments/good03.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo ' bar
11 changes: 11 additions & 0 deletions testing/regression-tests/comments/good03.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
good01.in

Parse Successful!

[Abstract Syntax]

Foo

[Linearized tree]

foo
7 changes: 7 additions & 0 deletions testing/regression-tests/comments/test.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- This grammar tests different comment tokens

Foo. F ::= "foo" ;

comment "//" ;
comment "\"" ;
comment "'" ;
3 changes: 2 additions & 1 deletion testing/src/ParameterizedTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ testCases :: TestParameters -> [Test]
testCases params = do
map makeTestCase
[ "regression-tests/#100_coercion_lists"
, "regression-tests/#134_category_named_I" ]
, "regression-tests/#134_category_named_I"
, "regression-tests/comments" ]
where
mkTitle dir = encodeString (filename dir)
makeTestCase dir =
Expand Down
4 changes: 2 additions & 2 deletions testing/src/TestUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Text as T

-- system-filepath
import Filesystem.Path (filename, stripPrefix)
import Filesystem.Path.CurrentOS (encodeString, toText, encode)
import Filesystem.Path.CurrentOS (encodeString, toText)

-- shelly
import Shelly
Expand Down Expand Up @@ -105,4 +105,4 @@ findFile n = do
Nothing -> assertFailure "File not found" >> undefined

matchFilePath :: String -> FilePath -> Bool
matchFilePath regex name = encode name =~ regex
matchFilePath regex name = encodeString name =~ regex

0 comments on commit 3d0dcde

Please sign in to comment.