Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a couple more tests

I went through d0f3a7e and made sure
everything there is here.

Test Plan:
Ran the tests.

Auditors: eater
  • Loading branch information...
commit 4c6eb68927eacc30a57ca35813530b9f70fceec2 1 parent 34ced15
@spicyj spicyj authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 utils/test/answer-types.html
View
17 utils/test/answer-types.html
@@ -375,6 +375,7 @@ <h2 id="qunit-userAgent"></h2>
testAnswer(answerData, "12345.6788", false, "wrong answer is wrong");
testAnswer(answerData, "12345.6789", true, "right answer is right");
+ testAnswer(answerData, "12345,6789", true, "right answer with decimal comma is right");
testAnswer(answerData, "12,345.6789", true, "right answer with commas is right");
testAnswer(answerData, "12,345.678,9", true, "right answer with commas is right");
testAnswer(answerData, "12.345,6789", true, "right answer with periods is right");
@@ -433,6 +434,22 @@ <h2 id="qunit-userAgent"></h2>
start();
});
+ asyncTest("number generic 41.976", 4, function() {
+ var $problem = jQuery("#qunit-fixture .problem").append(
+ "<p class='solution'>41.976<\/p>"
+ );
+
+ var answerData = Khan.answerTypes.number.setup($("#solutionarea"),
+ $problem.children(".solution"));
+
+ testAnswer(answerData, "419.76", false, "wrong answer is wrong");
+ testAnswer(answerData, "41976", false, "right answer is right");
+ testAnswer(answerData, "41,976", false, "right answer with comma is right");
+ testAnswer(answerData, "41.976", false, "right answer with period is right");
+
+ start();
+ });
+
asyncTest("radio answerability", 8, function() {
var $problem = jQuery("#qunit-fixture .problem").append(
"<p class='solution'><code>6<\/code><\/p>" +
Please sign in to comment.
Something went wrong with that request. Please try again.