Skip to content

Commit aad1fdd

Browse files
authored
Merge pull request #5514 from bbarker/runOnly_unison_syntax
add runOnly support for unison-syntax tests
2 parents a2d3c2c + 0bc8cac commit aad1fdd

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

CONTRIBUTORS.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,4 @@ The format for this list: name, GitHub handle
8989
* Eduard Nicodei (@neduard)
9090
* Brian McKenna (@puffnfresh)
9191
* Ruslan Simchuk (@SimaDovakin)
92+
* Brandon Barker (@bbarker)

unison-syntax/test/Main.hs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
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+
test :: Test ()
11+
test =
12+
tests
13+
[ Doc.test,
14+
Unison.test
15+
]
16+
817
main :: IO ()
9-
main = withCP65001 . run $ tests [Unison.test, Doc.test]
18+
main = withCP65001 do
19+
args <- getArgs
20+
mapM_ (`hSetEncoding` utf8) [stdout, stdin, stderr]
21+
case args of
22+
[] -> runOnly "" test
23+
[prefix] -> runOnly prefix test
24+
[seed, prefix] -> rerunOnly (read seed) prefix test
25+
_ -> 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)