Skip to content

Commit

Permalink
Merge pull request #5514 from bbarker/runOnly_unison_syntax
Browse files Browse the repository at this point in the history
add runOnly support for unison-syntax tests
  • Loading branch information
aryairani authored Dec 23, 2024
2 parents a2d3c2c + 0bc8cac commit aad1fdd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,4 @@ The format for this list: name, GitHub handle
* Eduard Nicodei (@neduard)
* Brian McKenna (@puffnfresh)
* Ruslan Simchuk (@SimaDovakin)
* Brandon Barker (@bbarker)
18 changes: 17 additions & 1 deletion unison-syntax/test/Main.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
module Main (main) where

import EasyTest
import System.Environment (getArgs)
import System.IO
import System.IO.CodePage (withCP65001)
import Unison.Test.Doc qualified as Doc
import Unison.Test.Unison qualified as Unison

test :: Test ()
test =
tests
[ Doc.test,
Unison.test
]

main :: IO ()
main = withCP65001 . run $ tests [Unison.test, Doc.test]
main = withCP65001 do
args <- getArgs
mapM_ (`hSetEncoding` utf8) [stdout, stdin, stderr]
case args of
[] -> runOnly "" test
[prefix] -> runOnly prefix test
[seed, prefix] -> rerunOnly (read seed) prefix test
_ -> error "expected no args, a prefix, or a seed and a prefix"
2 changes: 1 addition & 1 deletion unison-syntax/test/Unison/Test/Doc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Unison.Util.Recursion

test :: Test ()
test =
scope "Doc parser" . tests $
scope "DocParser" . tests $
[ t "# Hello" [Doc.Section (Doc.Paragraph $ docWord "Hello" :| []) []],
t
( unlines
Expand Down

0 comments on commit aad1fdd

Please sign in to comment.