From 866058e464d5e683f67734c5292dedfba60a91d3 Mon Sep 17 00:00:00 2001 From: Brandon Barker Date: Sat, 21 Dec 2024 08:54:18 -0500 Subject: [PATCH 1/3] add runOnly support for unison-syntax tests --- unison-syntax/test/Main.hs | 21 ++++++++++++++++++++- unison-syntax/test/Unison/Test/Doc.hs | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/unison-syntax/test/Main.hs b/unison-syntax/test/Main.hs index 3c84130548..fb4da5c3d0 100644 --- a/unison-syntax/test/Main.hs +++ b/unison-syntax/test/Main.hs @@ -1,9 +1,28 @@ 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 +-- main :: IO () +-- main = withCP65001 . run $ tests [Unison.test, Doc.test] + +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" diff --git a/unison-syntax/test/Unison/Test/Doc.hs b/unison-syntax/test/Unison/Test/Doc.hs index cc4bedf4ce..9028404ada 100644 --- a/unison-syntax/test/Unison/Test/Doc.hs +++ b/unison-syntax/test/Unison/Test/Doc.hs @@ -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 From c5d9f883dc4444113c3fbcdd0eb1df86446a9cec Mon Sep 17 00:00:00 2001 From: Brandon Barker Date: Sat, 21 Dec 2024 08:57:59 -0500 Subject: [PATCH 2/3] remove comment --- unison-syntax/test/Main.hs | 3 --- 1 file changed, 3 deletions(-) diff --git a/unison-syntax/test/Main.hs b/unison-syntax/test/Main.hs index fb4da5c3d0..825bf870d5 100644 --- a/unison-syntax/test/Main.hs +++ b/unison-syntax/test/Main.hs @@ -7,9 +7,6 @@ import System.IO.CodePage (withCP65001) import Unison.Test.Doc qualified as Doc import Unison.Test.Unison qualified as Unison --- main :: IO () --- main = withCP65001 . run $ tests [Unison.test, Doc.test] - test :: Test () test = tests From 0bc8cac1db7b1f0d92f434ceb8fa877eff96ade2 Mon Sep 17 00:00:00 2001 From: Brandon Barker Date: Sun, 22 Dec 2024 14:11:08 -0500 Subject: [PATCH 3/3] signing CONTRIBUTORS.markdown --- CONTRIBUTORS.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.markdown b/CONTRIBUTORS.markdown index 413ef3da70..57d863bfb8 100644 --- a/CONTRIBUTORS.markdown +++ b/CONTRIBUTORS.markdown @@ -89,3 +89,4 @@ The format for this list: name, GitHub handle * Eduard Nicodei (@neduard) * Brian McKenna (@puffnfresh) * Ruslan Simchuk (@SimaDovakin) +* Brandon Barker (@bbarker)