@@ -6,28 +6,28 @@ $(document).ready(function(){
6
6
test ( "exec" , function ( ) {
7
7
var numberFinder = / ( \d ) .* ( \d ) / ;
8
8
var results = numberFinder . exec ( "what if 6 turned out to be 9?" ) ;
9
- ok ( results . equalTo ( [ __ , __ , __ ] ) , 'what is the value of results?' ) ;
9
+ ok ( results . equalTo ( [ "6 turned out to be 9" , "6" , "9" ] ) , 'what is the value of results?' ) ;
10
10
} ) ;
11
11
12
12
test ( "test" , function ( ) {
13
13
var containsSelect = / s e l e c t / . test ( " select * from users " ) ;
14
- equals ( containsSelect , __ , 'does the string provided contain "select"?' ) ;
14
+ equals ( containsSelect , true , 'does the string provided contain "select"?' ) ;
15
15
} ) ;
16
16
17
17
test ( "match" , function ( ) {
18
18
var matches = "what if 6 turned out to be 9?" . match ( / ( \d ) / g) ;
19
- ok ( matches . equalTo ( [ __ , __ ] ) , 'what is the value of matches?' ) ;
19
+ ok ( matches . equalTo ( [ "6" , "9" ] ) , 'what is the value of matches?' ) ;
20
20
} ) ;
21
21
22
22
test ( "replace" , function ( ) {
23
23
var pie = "apple pie" . replace ( "apple" , "strawberry" ) ;
24
- equals ( pie , __ , 'what is the value of pie?' ) ;
24
+ equals ( pie , "strawberry pie" , 'what is the value of pie?' ) ;
25
25
26
26
pie = "what if 6 turned out to be 9?" . replace ( / \d / g, function ( number ) { // the second parameter can be a string or a function
27
27
var map = { '6' : 'six' , '9' : 'nine' } ;
28
28
return map [ number ] ;
29
29
} ) ;
30
- equals ( pie , __ , 'what is the value of pie?' ) ;
30
+ equals ( pie , "what if six turned out to be nine?" , 'what is the value of pie?' ) ;
31
31
} ) ;
32
32
33
33
// THE END
0 commit comments