Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/mhs.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 3 additions & 11 deletions markdown-unlit.cabal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Text/Markdown/Unlit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion test/Spec.hs
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions test/Text/Markdown/UnlitSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading