Skip to content

Commit 866058e

Browse files
committed
add runOnly support for unison-syntax tests
1 parent a2d3c2c commit 866058e

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

unison-syntax/test/Main.hs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
module Main (main) where
22

33
import EasyTest
4+
import System.Environment (getArgs)
5+
import System.IO
46
import System.IO.CodePage (withCP65001)
57
import Unison.Test.Doc qualified as Doc
68
import Unison.Test.Unison qualified as Unison
79

10+
-- main :: IO ()
11+
-- main = withCP65001 . run $ tests [Unison.test, Doc.test]
12+
13+
test :: Test ()
14+
test =
15+
tests
16+
[ Doc.test,
17+
Unison.test
18+
]
19+
820
main :: IO ()
9-
main = withCP65001 . run $ tests [Unison.test, Doc.test]
21+
main = withCP65001 do
22+
args <- getArgs
23+
mapM_ (`hSetEncoding` utf8) [stdout, stdin, stderr]
24+
case args of
25+
[] -> runOnly "" test
26+
[prefix] -> runOnly prefix test
27+
[seed, prefix] -> rerunOnly (read seed) prefix test
28+
_ -> error "expected no args, a prefix, or a seed and a prefix"

unison-syntax/test/Unison/Test/Doc.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Unison.Util.Recursion
1515

1616
test :: Test ()
1717
test =
18-
scope "Doc parser" . tests $
18+
scope "DocParser" . tests $
1919
[ t "# Hello" [Doc.Section (Doc.Paragraph $ docWord "Hello" :| []) []],
2020
t
2121
( unlines

0 commit comments

Comments
 (0)