Fix allowing typing of constructor names

This commit is contained in:
Chris Done 2017-12-06 12:27:55 +00:00
parent dc997728d4
commit 766323f06c
2 changed files with 10 additions and 5 deletions

View File

@ -555,7 +555,7 @@ insertCharInto char =
_ -> p)
n -> n
where
letter = isLetter char
letter = isLetter char && isLower char
digit = isDigit char
operator = elem char ("*/+-" :: [Char])

View File

@ -46,10 +46,8 @@ tests =
"Type valid name"
(typeChars "foo")
(makeState "foo" initExpression)
, Test
"Ignore invalid name"
(typeChars "123")
initState
, Test "Ignore invalid name (digits)" (typeChars "123") initState
, Test "Ignore invalid name (upper)" (typeChars "F") initState
, Test
"Type valid name, delete characters"
(typeChars "foo" <> typeBackspace <> typeBackspace)
@ -72,6 +70,13 @@ tests =
(VariableExpression
(Label {labelUUID = starterExprUUID})
(Identifier {identifierString = "foo"})))
, Test
"Ignore uppercase beginning"
(typeChars "Foo")
(rhsSelectedState
(VariableExpression
(Label {labelUUID = starterExprUUID})
(Identifier {identifierString = "oo"})))
, Test
"Type variable name, delete characters"
(typeChars "foo" <> typeBackspace <> typeBackspace)