fix(challenges): fixed tests to check for pre operators
Increment and decrement a number challenge will now check for post-increment ISSUES CLOSED: #199
This commit is contained in:
committed by
Kristofer Koishigawa
parent
8f17adf2c6
commit
ded4705fac
@ -661,7 +661,7 @@
|
|||||||
{
|
{
|
||||||
"text": "<code>myVar = myVar + 1;</code> should be changed",
|
"text": "<code>myVar = myVar + 1;</code> should be changed",
|
||||||
"testString":
|
"testString":
|
||||||
"assert(/var\\s*myVar\\s*=\\s*87;\\s*\\/*.*\\s*myVar\\+\\+;/.test(code), '<code>myVar = myVar + 1;</code> should be changed');"
|
"assert(/var\\s*myVar\\s*=\\s*87;\\s*\\/*.*\\s*([+]{2}\\s*myVar|myVar\\s*[+]{2});/.test(code), '<code>myVar = myVar + 1;</code> should be changed');"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "Use the <code>++</code> operator",
|
"text": "Use the <code>++</code> operator",
|
||||||
@ -729,7 +729,7 @@
|
|||||||
{
|
{
|
||||||
"text": "<code>myVar = myVar - 1;</code> should be changed",
|
"text": "<code>myVar = myVar - 1;</code> should be changed",
|
||||||
"testString":
|
"testString":
|
||||||
"assert(/var\\s*myVar\\s*=\\s*11;\\s*\\/*.*\\s*myVar--;/.test(code), '<code>myVar = myVar - 1;</code> should be changed');"
|
"assert(/var\\s*myVar\\s*=\\s*11;\\s*\\/*.*\\s*([-]{2}\\s*myVar|myVar\\s*[-]{2});/.test(code), '<code>myVar = myVar - 1;</code> should be changed');"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "Use the <code>--</code> operator on <code>myVar</code>",
|
"text": "Use the <code>--</code> operator on <code>myVar</code>",
|
||||||
|
Reference in New Issue
Block a user