Improve increment and decrement instructions, tests

pull/5584/head
SaintPeter 2015-12-30 13:18:48 -08:00
parent 6aca2c5cff
commit ba0a360c49
1 changed files with 5 additions and 3 deletions

View File

@ -393,6 +393,7 @@
"<code>i++;</code>",
"is the equivalent of",
"<code>i = i + 1;</code>",
"<strong>Note</strong><br>The entire line becomes <code>i++;</code>, eliminating the need for the equal sign.",
"<h4>Instructions</h4>",
"Change the code to use the <code>++</code> operator on <code>myVar</code>"
],
@ -412,7 +413,7 @@
],
"tests": [
"assert(myVar === 88, 'message: <code>myVar</code> should equal <code>88</code>');",
"assert(/[+]{2}/.test(code), 'message: Use the <code>++</code> operator');",
"assert(/myVar\\s*[+]{2}/.test(code), 'message: Use the <code>++</code> operator');",
"assert(/var myVar = 87;/.test(code), 'message: Do not change code above the line');"
],
"type": "waypoint",
@ -431,6 +432,7 @@
"<code>i--;</code>",
"is the equivalent of",
"<code>i = i - 1;</code>",
"<strong>Note</strong><br>The entire line becomes <code>i--;</code>, eliminating the need for the equal sign.",
"<h4>Instructions</h4>",
"Change the code to use the <code>--</code> operator on <code>myVar</code>"
],
@ -450,7 +452,7 @@
],
"tests": [
"assert(myVar === 10, 'message: <code>myVar</code> should equal <code>10</code>');",
"assert(/myVar[-]{2}/.test(code), 'message: Use the <code>--</code> operator on <code>myVar</code>');",
"assert(/myVar\\s*[-]{2}/.test(code), 'message: Use the <code>--</code> operator on <code>myVar</code>');",
"assert(/var myVar = 11;/.test(code), 'message: Do not change code above the line');"
],
"type": "waypoint",
@ -5139,4 +5141,4 @@
"isBeta": "true"
}
]
}
}