@@ -6,15 +6,15 @@ test("if", function() {
66 if ( 2 > 0 ) {
77 isPositive = true ;
88 }
9- equals ( isPositive , __ , 'what is the value of isPositive?' ) ;
9+ equals ( isPositive , true , 'what is the value of isPositive?' ) ;
1010} ) ;
1111
1212test ( "for" , function ( ) {
1313 var counter = 10 ;
1414 for ( var i = 1 ; i <= 3 ; i ++ ) {
1515 counter = counter + i ;
1616 }
17- equals ( counter , __ , 'what is the value of counter?' ) ;
17+ equals ( counter , 16 , 'what is the value of counter?' ) ;
1818} ) ;
1919
2020test ( "for in" , function ( ) {
@@ -25,18 +25,18 @@ test("for in", function() {
2525 } ;
2626 var result = "" ;
2727 // for in enumerates the property names of an object
28- for ( property_name in person ) {
29- result = result + property_name ;
30- } ;
31- equals ( result , __ , 'what is the value of result?' ) ;
28+ for ( var property_name in person ) {
29+ result = result + property_name ;
30+ }
31+ equals ( result , "nameage" , 'what is the value of result?' ) ;
3232} ) ;
3333
3434test ( "ternary operator" , function ( ) {
3535 var fruit = true ? "apple" : "orange" ;
36- equals ( fruit , __ , 'what is the value of fruit?' ) ;
36+ equals ( fruit , "apple" , 'what is the value of fruit?' ) ;
3737
3838 fruit = false ? "apple" : "orange" ;
39- equals ( fruit , __ , 'now what is the value of fruit?' ) ;
39+ equals ( fruit , "orange" , 'now what is the value of fruit?' ) ;
4040} ) ;
4141
4242test ( "switch" , function ( ) {
@@ -49,7 +49,7 @@ test("switch", function() {
4949 result = 2 ;
5050 break ;
5151 }
52- equals ( result , __ , 'what is the value of result?' ) ;
52+ equals ( result , 2 , 'what is the value of result?' ) ;
5353} ) ;
5454
5555test ( "switch default case" , function ( ) {
@@ -65,10 +65,10 @@ test("switch default case", function() {
6565 result = "Merry" ;
6666 break ;
6767 }
68- equals ( result , __ , 'what is the value of result?' ) ;
68+ equals ( result , "Merry" , 'what is the value of result?' ) ;
6969} ) ;
7070
7171test ( "null coallescion" , function ( ) {
7272 var result = null || "a value" ;
73- equals ( result , __ , 'what is the value of result?' ) ;
73+ equals ( result , "a value" , 'what is the value of result?' ) ;
7474} ) ;
0 commit comments