@@ -4,28 +4,28 @@ module("About Regular Expressions (topics/about_regular_expressions.js)");
44test ( "exec" , function ( ) {
55 var numberFinder = / ( \d ) .* ( \d ) / ;
66 var results = numberFinder . exec ( "what if 6 turned out to be 9?" ) ;
7- ok ( results . equalTo ( [ __ , __ , __ ] ) , 'what is the value of results?' ) ;
7+ ok ( results . equalTo ( [ "6 turned out to be 9" , '6' , '9' ] ) , 'what is the value of results?' ) ;
88} ) ;
99
1010test ( "test" , function ( ) {
1111 var containsSelect = / s e l e c t / . test ( " select * from users " ) ;
12- equal ( __ , containsSelect , 'does the string provided contain "select"?' ) ;
12+ equal ( true , containsSelect , 'does the string provided contain "select"?' ) ;
1313} ) ;
1414
1515test ( "match" , function ( ) {
1616 var matches = "what if 6 turned out to be 9?" . match ( / ( \d ) / g) ;
17- ok ( matches . equalTo ( [ __ , __ ] ) , 'what is the value of matches?' ) ;
17+ ok ( matches . equalTo ( [ '6' , '9' ] ) , 'what is the value of matches?' ) ;
1818} ) ;
1919
2020test ( "replace" , function ( ) {
2121 var pie = "apple pie" . replace ( "apple" , "strawberry" ) ;
22- equal ( __ , pie , 'what is the value of pie?' ) ;
22+ equal ( 'strawberry pie' , pie , 'what is the value of pie?' ) ;
2323
2424 pie = "what if 6 turned out to be 9?" . replace ( / \d / g, function ( number ) { // the second parameter can be a string or a function
2525 var map = { '6' : 'six' , '9' : 'nine' } ;
2626 return map [ number ] ;
2727 } ) ;
28- equal ( __ , pie , 'what is the value of pie?' ) ;
28+ equal ( 'what if six turned out to be nine?' , pie , 'what is the value of pie?' ) ;
2929} ) ;
3030
3131// THE END
0 commit comments