@@ -662,6 +662,29 @@ test("iban", function() {
662
662
ok ( method ( "GB29 NWBK 6016 1331 9268 19" ) , "Valid IBAN - GB" ) ;
663
663
} ) ;
664
664
665
+ test ( "postcodeUK" , function ( ) {
666
+ var method = methodTest ( "postcodeUK" ) ;
667
+ ok ( method ( "AA9A 9AA" ) , "Valid postcode" ) ;
668
+ ok ( method ( "A9A 9AA" ) , "Valid postcode" ) ;
669
+ ok ( method ( "A9 9AA" ) , "Valid postcode" ) ;
670
+ ok ( method ( "A99 9AA" ) , "Valid postcode" ) ;
671
+ ok ( method ( "AA9 9AA" ) , "Valid postcode" ) ;
672
+ ok ( method ( "AA99 9AA" ) , "Valid postcode" ) ;
673
+
674
+ // Channel Island
675
+ ok ( ! method ( "AAAA 9AA" ) , "Invalid postcode" ) ;
676
+ ok ( ! method ( "AA-2640" ) , "Invalid postcode" ) ;
677
+
678
+ ok ( ! method ( "AAA AAA" ) , "Invalid postcode" ) ;
679
+ ok ( ! method ( "AA AAAA" ) , "Invalid postcode" ) ;
680
+ ok ( ! method ( "A AAAA" ) , "Invalid postcode" ) ;
681
+ ok ( ! method ( "AAAAA" ) , "Invalid postcode" ) ;
682
+ ok ( ! method ( "999 999" ) , "Invalid postcode" ) ;
683
+ ok ( ! method ( "99 9999" ) , "Invalid postcode" ) ;
684
+ ok ( ! method ( "9 9999" ) , "Invalid postcode" ) ;
685
+ ok ( ! method ( "99999" ) , "Invalid postcode" ) ;
686
+ } ) ;
687
+
665
688
test ( "dateNL" , function ( ) {
666
689
var method = methodTest ( "dateNL" ) ;
667
690
ok ( method ( "01-01-1900" ) , "Valid date NL" ) ;
0 commit comments