diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml new file mode 100644 index 0000000..506e8af --- /dev/null +++ b/.github/workflows/mhs.yml @@ -0,0 +1,25 @@ +name: MicroHs + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + pull_request: + branches: + - main + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + # - macos-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: sol/setup-MicroHs@nightly + - run: mcabal -r build + - run: dist-mcabal/bin/mhs/spec diff --git a/markdown-unlit.cabal b/markdown-unlit.cabal index a80ecef..ebbac60 100644 --- a/markdown-unlit.cabal +++ b/markdown-unlit.cabal @@ -28,7 +28,6 @@ library ghc-options: -Wall build-depends: base ==4.* - , base-compat exposed-modules: Text.Markdown.Unlit other-modules: @@ -44,27 +43,20 @@ executable markdown-unlit ghc-options: -Wall build-depends: base ==4.* - , base-compat , markdown-unlit default-language: Haskell2010 -test-suite spec - type: exitcode-stdio-1.0 +executable spec main-is: Spec.hs hs-source-dirs: test src ghc-options: -Wall cpp-options: -DTEST - build-tool-depends: - hspec-discover:hspec-discover build-depends: - QuickCheck - , base ==4.* - , base-compat + base ==4.* , directory - , hspec ==2.* - , silently + , nanospec , stringbuilder , temporary other-modules: diff --git a/src/Text/Markdown/Unlit.hs b/src/Text/Markdown/Unlit.hs index 948e6ed..14a7122 100644 --- a/src/Text/Markdown/Unlit.hs +++ b/src/Text/Markdown/Unlit.hs @@ -18,10 +18,10 @@ module Text.Markdown.Unlit ( ) where import Prelude () -import Prelude.Compat +import Prelude import Control.Arrow import Data.Char -import Data.List.Compat +import Data.List import Data.Maybe import Data.String import System.Environment @@ -49,7 +49,7 @@ run args = -- #line 1 "label" -- case break (== "-h") args of - (mkSelector -> selector, "-h" : files) -> case files of + ((mkSelector -> selector), "-h" : files) -> case files of [src, cur, dst] -> do readFileUtf8 cur >>= writeFileUtf8 dst . unlit src selector [src] -> do diff --git a/test/Spec.hs b/test/Spec.hs index a824f8c..1ee3230 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -1 +1,7 @@ -{-# OPTIONS_GHC -F -pgmF hspec-discover #-} +module Main where + +import Test.Hspec +import qualified Text.Markdown.UnlitSpec + +main :: IO () +main = hspec Text.Markdown.UnlitSpec.spec diff --git a/test/Text/Markdown/UnlitSpec.hs b/test/Text/Markdown/UnlitSpec.hs index 8c0754f..586973b 100644 --- a/test/Text/Markdown/UnlitSpec.hs +++ b/test/Text/Markdown/UnlitSpec.hs @@ -2,7 +2,6 @@ module Text.Markdown.UnlitSpec (main, spec) where import Test.Hspec -import Test.QuickCheck import Data.String.Builder import System.Environment import Control.Exception @@ -113,9 +112,6 @@ spec = do it "can handle a combination of :&: and :|:" $ do parseSelector "foo+bar baz+bar" `shouldBe` Just ("foo" :&: "bar" :|: "baz" :&: "bar") - it "is total" $ do - property $ \xs -> parseSelector xs `seq` True - describe "unlit" $ do it "can be used to unlit everything with a specified class" $ do unlit "Foo.lhs" "foo" . build $ do