forked from syntaxhighlighter/syntaxhighlighter
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'xregexp-tostring' of git://github.com/rwstauner/SyntaxH…
…ighlighter into merges
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<pre id="sh_015_xregexp" class="brush: js;" title="XRegExp tests"> | ||
// test XRegExp | ||
</pre> | ||
|
||
<script type="text/javascript"> | ||
queue(function() | ||
{ | ||
module('015_xregexp'); | ||
|
||
test('test XRegExp', function() | ||
{ | ||
(function(){ | ||
var desc = 'Overridden RegExp.exec on numeric arguments with empty captures', | ||
match; | ||
try { | ||
match = /(x)?(\d)(\d)/.exec( 213 ); | ||
ok(match, desc); | ||
ok(match[0] === "21", 'matched string'); | ||
ok(match[1] === undefined, 'empty capture group is undefined'); | ||
ok(match[2] === "2", 'matched capture group returned expected string'); | ||
ok(match[3] === "1", 'matched capture group returned expected string'); | ||
} catch( ex ) { | ||
ok(false, 'Caught Exception: ' + desc + '(' + ex.description + ')'); | ||
} | ||
})(); | ||
}); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters