File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,14 @@ main = hspec $ do
2121
2222 describe " HasParser Identifier" $ do
2323 it " can parse the result of prettyShow" $
24- property $ \ i -> parseM " Identifier" (prettyShow i) == Just (i :: Identifier )
24+ identProperty $ \ i -> parseM " Identifier" (prettyShow i) == Just (i :: Identifier )
2525 it " can parse the result of quote" $
2626 stringIdentProperty $ \ str -> parseM " Identifier" (quote str) == Just (ident # str)
2727
2828stringIdentProperty :: (String -> Bool ) -> Property
2929stringIdentProperty p = property $ \ s ->
30- '\ 0 ' `notElem` s ==> p s
30+ '\ 0 ' `notElem` s ==> classify (needsQuoting s) " need quoting" $ p s
31+
32+ identProperty :: (Identifier -> Bool ) -> Property
33+ identProperty p = property $ \ i ->
34+ classify (needsQuoting (from ident # i)) " need quoting" $ p i
You can’t perform that action at this time.
0 commit comments