Skip to content

Commit b68ec22

Browse files
committed
got more donesy
1 parent e21b46c commit b68ec22

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

topics/about_assignment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ test("local variables", function() {
88

99
test("global variables", function() {
1010
temp = 1; // Not using var is an example. Always use var in practise.
11-
equal(window.1, temp, 'global variables are assigned to the window object');
11+
equal(1, temp, 'global variables are assigned to the window object');
1212
});

topics/about_control_structures.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ test("for in", function() {
2727
for (var property_name in person) {
2828
result = result + property_name;
2929
}
30-
equal(__), result, 'what is the value of result?');
30+
equal("nameage", result, 'what is the value of result?');
3131
});
3232

3333
test("ternary operator", function() {
3434
var fruit = true ? "apple" : "orange";
35-
equal(__, fruit, 'what is the value of fruit?');
35+
equal("apple", fruit, 'what is the value of fruit?');
3636

3737
fruit = false ? "apple" : "orange";
38-
equal(__, fruit, 'now what is the value of fruit?');
38+
equal("orange", fruit, 'now what is the value of fruit?');
3939
});
4040

4141
test("switch", function() {
@@ -48,7 +48,7 @@ test("switch", function() {
4848
result = 2;
4949
break;
5050
}
51-
equal(__, result, 'what is the value of result?');
51+
equal(2, result, 'what is the value of result?');
5252
});
5353

5454
test("switch default case", function() {
@@ -64,10 +64,10 @@ test("switch default case", function() {
6464
result = "Merry";
6565
break;
6666
}
67-
equal(__, result, 'what is the value of result?');
67+
equal("Merry", result, 'what is the value of result?');
6868
});
6969

7070
test("null coalescing", function() {
7171
var result = null || "a value";
72-
equal(__, result, 'what is the value of result?');
72+
equal("a value", result, 'what is the value of result?');
7373
});

topics/about_numbers.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ module("About Numbers (topics/about_numbers.js)");
44
test("types", function() {
55
var typeOfIntegers = typeof(6);
66
var typeOfFloats = typeof(3.14159);
7-
equal(false, typeOfIntegers === typeOfFloats, 'are ints and floats the same type?');
8-
equal(__, typeOfIntegers, 'what is the javascript numeric type?');
9-
equal(__, 1.0, 'what is a integer number equivalent to 1.0?');
7+
equal(true, typeOfIntegers === typeOfFloats, 'are ints and floats the same type?');
8+
equal("number", typeOfIntegers, 'what is the javascript numeric type?');
9+
equal(1, 1.0, 'what is a integer number equivalent to 1.0?');
1010
});
1111

1212
test("NaN", function() {
1313
var resultOfFailedOperations = 7/'apple';
14-
equal(__, isNaN(resultOfFailedOperations), 'what will satisfy the equals assertion?');
15-
equal(__, resultOfFailedOperations == NaN, 'is NaN == NaN?');
14+
equal(true, isNaN(resultOfFailedOperations), 'what will satisfy the equals assertion?');
15+
equal(false, resultOfFailedOperations == NaN, 'is NaN == NaN?');
1616
});

topics/about_objects.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ module("About Objects (topics/about_objects.js)");
33

44
test("object type", function() {
55
var empty_object = {};
6-
equal(literal, typeof(empty_object), 'what is the type of an object?');
6+
equal("object", typeof(empty_object), 'what is the type of an object?');
77
});
88

99
test("object literal notation", function() {
1010
var person = {
11-
name:"Amory Blaine",
12-
age:"102"
11+
name:{},
12+
age:{}
1313
};
14-
equal("Amory Blaine", person.name, "what is the person's name?");
15-
equal(102, person.age, "what is the person's age?");
14+
equal(undefined, person.name, "what is the person's name?");
15+
equal(undefined, person.age, "what is the person's age?");
1616
});
1717

1818
test("dynamically adding properties", function() {
@@ -21,12 +21,12 @@ test("dynamically adding properties", function() {
2121
person.__ = 102;
2222
equal("Amory Blaine", person.name, "what is the person's name?");
2323
equal(102, person.age, "what is the person's age?");
24-
});
24+
});
2525

2626
test("adding properties from strings", function() {
2727
var person = {};
28-
person["__"] = "Amory Blaine";
29-
person["__"] = 102;
28+
person["name"] = "Amory Blaine";
29+
person["age"] = 102;
3030
equal("Amory Blaine", person.name, "what is the person's name?");
3131
equal(102, person.age, "what is the person's age?");
3232
});

topics/about_strings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test("concatenation", function() {
1515

1616
test("character Type", function() {
1717
var characterType = typeof("Amory".charAt(1)); // typeof will be explained in about reflection
18-
equal("m", var characterType = typeof("Amory".charAt(1));, 'Javascript has no character type');
18+
equal("string", characterType, 'Javascript has no character type');
1919
});
2020

2121
test("escape character", function() {

0 commit comments

Comments
 (0)