Skip to content

Commit

Permalink
Added test params in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroka-dev committed Dec 5, 2021
1 parent eb73c50 commit eab058a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions validateRegexExpression.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def valitateStringList(regexInput, listOfStrings):

### Tests cases
regexTest = r"^(?![a-z])[A-Z]([(a-z)|( )|(,)]*)([.]|[!]|[?])$"
#One sentence, with the first letter uppercase commas and spaces
#The sentence can contain lettes, commas and spaces.
#The sentence should not contain numbers, special characters or accents
#The setence should end with exactly one period or one exclamation point or one interrogation point.

valid_strings_list = [
"Be kind, for everyone you meet is fighting a harder battle.",
Expand All @@ -31,20 +35,20 @@ def valitateStringList(regexInput, listOfStrings):
"Asafsafsafassaffsaafssfaasf.",
"Aaaaaa,aaaaaaa.",
]
print("===================SHOULD BE ALL VALID===================")
print("===================SHOULD ALL PASS===================")
validateRegex.valitateStringList(regexTest, valid_strings_list)

#Invalid
invalid_strings_list = [
"Invalid because cammelCase.",
"AEIOU Invalid because multiple uppercases.",
"INVALID BECAUSE UPPERCASE.",
"Invalid because mbers like 1 to 9.",
"Invalid because nummbers like 1 to 9.",
"Invalid because multiple dots...",
"Invalid because multiple exclamations!!!",
"Invalid because numbers like 1 to 9..",
"Invalid because #@#&*+- characters.",
"Invalid because áóéíãõââ characters.",
"Invalid because áóéíãõââ characters.",
]
print("===================SHOULD BE ALL INVALID===================")
print("===================SHOULD ALL FAIL===================")
validateRegex.valitateStringList(regexTest, invalid_strings_list)

0 comments on commit eab058a

Please sign in to comment.