fix(challenges): fix #17155
i've added a test for if else statements curly braces to ensure that every condition has to have both opening and closing curly braces. I've also made changes that were by scissorsneedfood. ISSUES CLOSED: #17155
This commit is contained in:
committed by
Kristofer Koishigawa
parent
6058da3725
commit
cb21e59f7a
@ -5066,6 +5066,12 @@
|
||||
"testString":
|
||||
"assert(code.match(/if/g).length > 1, 'You should have at least two <code>if</code> statements');"
|
||||
},
|
||||
{
|
||||
"text":
|
||||
"You should have closing and opening curly braces for each condition",
|
||||
"testString":
|
||||
"assert(code.match(/if\\s*\\((.+)\\)\\s*\\{[\\s\\S]+\\}\\s*else if\\s*\\((.+)\\)\\s*\\{[\\s\\S]+\\}\\s*else\\s*\\{[\\s\\S]+\\s*\\}/), 'You should have closing and opening curly braces for each condition in your if else statement');"
|
||||
},
|
||||
{
|
||||
"text": "<code>testElseIf(0)</code> should return \"Smaller than 5\"",
|
||||
"testString":
|
||||
|
Reference in New Issue
Block a user