Pattern method: Convert string param to RegExp. Fixes issue #223

This commit is contained in:
gavacho
2012-02-22 11:49:06 -08:00
committed by Jörn Zaefferer
parent 520b6b7a18
commit 5dda6daa6c
2 changed files with 8 additions and 1 deletions

View File

@@ -533,6 +533,7 @@ test("maxWords", function() {
test("pattern", function() {
var method = methodTest("pattern");
ok( method( "AR1004", "AR\\d{4}" ), "Correct format for the given RegExp" );
ok( method( "AR1004", /^AR\d{4}$/ ), "Correct format for the given RegExp" );
ok( !method( "BR1004", /^AR\d{4}$/ ), "Invalid format for the given RegExp" );
});