mirror of
https://github.com/chrisdone/duet.git
synced 2025-01-08 06:53:22 +03:00
Fix allowing typing of constructor names
This commit is contained in:
parent
dc997728d4
commit
766323f06c
@ -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])
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user