mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-20 09:11:40 +01:00
Pattern method: Convert string param to RegExp. Fixes issue #223
This commit is contained in:
@@ -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" );
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user