on master help sign in
Renamed StringValue -> StringLiteral. Moved quotes from tests to StringLiteral's arbitrary
commitcda0a68584eb12b922e4b9ddf2c3e6392c950641 authortechtangents <dylan@techtangents.com> dateSun 17 Mar 2013, 20:58 (14 years ago) parentf60f383
2 files changed+9−9
elm/tests/Main.hs+4−4 elm/tests/Util/Arbs.hs+5−5
elm/tests/Main.hs+4−4
@@ -27,11 +27,11 @@ tests = [
2727 ]
2828 ]
2929
30−prop_assignString :: ValidIdent -> StringValue -> Bool
30+prop_assignString :: ValidIdent -> StringLiteral -> Bool
3131prop_assignString i s =
32− parses [qq|{i} = "{s}"|]
32+ parses [qq|{i} = {s}|]
3333
34−prop_invalidIdent :: ValidIdent -> InvalidIdentChar -> StringValue -> Bool
34+prop_invalidIdent :: ValidIdent -> InvalidIdentChar -> StringLiteral -> Bool
3535prop_invalidIdent i z s =
36− parseFails [qq|{i}{z} = "{s}"|]
36+ parseFails [qq|{i}{z} = {s}|]
3737
elm/tests/Util/Arbs.hs+5−5
@@ -17,13 +17,13 @@ instance Arbitrary ValidIdent where
1717 arbitrary = ValidIdent <$> ((:) <$> lowerAlpha <*> (listOf alphaNumUnderPrime))
1818
1919
20−newtype StringValue = StringValue String deriving (Eq, Show)
20+newtype StringLiteral = StringLiteral String deriving (Eq, Show)
2121
22−instance ShowQ StringValue where
23− showQ (StringValue v) = v
22+instance ShowQ StringLiteral where
23+ showQ (StringLiteral v) = v
2424
25−instance Arbitrary StringValue where
26− arbitrary = StringValue <$> escape <$> arbitrary
25+instance Arbitrary StringLiteral where
26+ arbitrary = StringLiteral <$> (\x -> "\"" ++ x ++ "\"") <$> escape <$> arbitrary
2727
2828
2929newtype InvalidIdentChar = InvalidIdentChar Char deriving (Eq, Show)