On windows, on a 64 bits machine, the following HUnit test code
module Main where
import Test.HUnit
import Text.Regex.Posix
testRegexSimple :: Test
testRegexSimple = TestCase $ do
assertBool "pattern matches regex ^(a)|(p)$" ( "p" =~ "^(a)|(p)$" )
testRegex :: Test
testRegex = TestCase $ do
assertBool "pattern matches regex ^(ab+cd?)|(ef{2}g{3,6}h{3,})|(p)$" ( "p" =~ "^(ab+cd?)|(ef{2}g{3,6}h{3,})|(p)$" )
tests = TestList
TestLabel "Regex Simple" testRegexSimple,
TestLabel "Regex" testRegex
main :: IO Counts
main = do runTestTT tests
runs perfectly using Haskell platform 2013.2.0.0 with ghc 7.6.3.
However, on stack LTS 7.13 with ghc 8.0.1 the second test fails! I assume this behaviour is the result of a bug.
Both use regex-posix 0.95.2, so it might be an error in the compiler
see https://ghc.haskell.org/trac/ghc/ticket/12974,
or it is a bug that was "hidden" by the old compiler...