Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
fix(challenges): fix #17155
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Strahinja Mitrovic authored and scissorsneedfoodtoo committed Aug 25, 2018
1 parent 6058da3 commit cb21e59
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit cb21e59

Please sign in to comment.