Skip to content

Commit 5d65210

Browse files
committed
Complete about_asserts and about_operators
1 parent 2ba675d commit 5d65210

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

topics/about_asserts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
module("About Asserts (topics/about_asserts.js)");
33

44
test("ok", function() {
5-
ok(__ === true, 'what will satisfy the ok assertion?');
5+
ok(true === true, 'what will satisfy the ok assertion?');
66
});
77

88
test("not ok", function() {
9-
ok(__ === false, 'what is a false value?');
9+
ok(false === false, 'what is a false value?');
1010
});
1111

1212
test("equal", function() {
13-
equal(__, 1 + 1, 'what will satisfy the equal assertion?');
13+
equal(2, 1 + 1, 'what will satisfy the equal assertion?');
1414
});

topics/about_operators.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test("addition", function() {
77
for (var i = 0; i <= 5; i++) {
88
result = result + i;
99
}
10-
equal(__, result, "What is the value of result?");
10+
equal(15, result, "What is the value of result?");
1111
});
1212

1313
test("assignment addition", function() {
@@ -16,23 +16,23 @@ test("assignment addition", function() {
1616
//the code below is just like saying result = result + i; but is more concise
1717
result += i;
1818
}
19-
equal(__, result, "What is the value of result?");
19+
equal(15, result, "What is the value of result?");
2020
});
2121

2222
test("subtraction", function() {
2323
var result = 5;
2424
for (var i = 0; i <= 2; i++) {
2525
result = result - i;
2626
}
27-
equal(__, result, "What is the value of result?");
27+
equal(2, result, "What is the value of result?");
2828
});
2929

3030
test("assignment subtraction", function() {
3131
var result = 5;
3232
for (var i = 0; i <= 2; i++) {
3333
result -= i;
3434
}
35-
equal(__, result, "What is the value of result?");
35+
equal(2, result, "What is the value of result?");
3636
});
3737

3838
//Assignment operators are available for multiplication and division as well
@@ -43,5 +43,5 @@ test("modulus", function() {
4343
var x = 5;
4444
//again this is exactly the same as result = result % x
4545
result %= x;
46-
equal(__, result, "What is the value of result?");
46+
equal(0, result, "What is the value of result?");
4747
});

0 commit comments

Comments
 (0)