Skip to content

Commit

Permalink
Merge pull request #152 from TripShot/brittle-test
Browse files Browse the repository at this point in the history
Fix brittle test
  • Loading branch information
cydparser authored Jul 3, 2024
2 parents 07d7ac2 + 7614318 commit 6b73703
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- "9.8"
- "9.10"
include:
- { os: macOS-latest, ghc: "9.8" }
- { os: windows-latest, ghc: "9.8" }
- { os: macOS-latest, ghc: "9.10" }
- { os: windows-latest, ghc: "9.10" }

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
steps:
- uses: nikeee/setup-pandoc@v1

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: haskell-actions/setup@v2
name: Setup Haskell Stack
Expand Down
15 changes: 3 additions & 12 deletions test/suite/Heist/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,16 @@ tests = [ testCase "loadErrors" loadErrorsTest
loadErrorsTest :: H.Assertion
loadErrorsTest = do
ets <- loadIO "templates-bad" mempty mempty mempty mempty
either (H.assertEqual "load errors test" expected . sort)
either (H.assertEqual "load errors test" expected . fmap (head . lines) . sort)
(const $ H.assertFailure "No failure when loading templates-bad")
ets
where
expected = sort
#if MIN_VERSION_base(4,9,0)
["templates-bad/apply-missing-attr.tpl: must supply \"template\" attribute in <apply>\nCallStack (from HasCallStack):\n error, called at src/Heist/Common.hs:76:15 in main:Heist.Common"
,"templates-bad/apply-template-not-found.tpl: apply tag cannot find template \"/page\"\nCallStack (from HasCallStack):\n error, called at src/Heist/Common.hs:76:15 in main:Heist.Common"
,"templates-bad/bind-infinite-loop.tpl: template recursion exceeded max depth, you probably have infinite splice recursion!\nCallStack (from HasCallStack):\n error, called at src/Heist/Common.hs:76:15 in main:Heist.Common"
,"templates-bad/bind-missing-attr.tpl: must supply \"tag\" attribute in <bind>\nCallStack (from HasCallStack):\n error, called at src/Heist/Common.hs:76:15 in main:Heist.Common"
]
#else
["templates-bad/bind-infinite-loop.tpl: template recursion exceeded max depth, you probably have infinite splice recursion!"
["templates-bad/apply-missing-attr.tpl: must supply \"template\" attribute in <apply>"
,"templates-bad/apply-template-not-found.tpl: apply tag cannot find template \"/page\""
,"templates-bad/bind-infinite-loop.tpl: template recursion exceeded max depth, you probably have infinite splice recursion!"
,"templates-bad/bind-missing-attr.tpl: must supply \"tag\" attribute in <bind>"
,"templates-bad/apply-missing-attr.tpl: must supply \"template\" attribute in <apply>"
]
#endif


attrSpliceTest :: IO ()
attrSpliceTest = do
Expand Down

0 comments on commit 6b73703

Please sign in to comment.