@@ -18,6 +18,7 @@ import {
1818 digits ,
1919 email ,
2020 fourDigitsCode ,
21+ macAddress ,
2122 phone ,
2223 sixDigitsCode ,
2324 spaces ,
@@ -44,6 +45,7 @@ const sixDigitsCodeTest = '123456'
4445const url1 = 'http://console.scaleway.com'
4546const url2 = 'https://www.scaleway.com'
4647const whitespace = ' \t\n\r\x0b\x0c'
48+ const macAddress1 = '1F:B5:FA:47:CD:C4'
4749
4850describe ( '@regex' , ( ) => {
4951 describe ( 'alpha' , ( ) => {
@@ -61,6 +63,7 @@ describe('@regex', () => {
6163 [ punctuation , false ] ,
6264 [ whitespace , false ] ,
6365 [ cronTest , false ] ,
66+ [ macAddress1 , false ] ,
6467 ] . forEach ( ( [ string , result ] ) =>
6568 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
6669 expect ( alpha . test ( string ) ) . toBe ( result ) ) ,
@@ -82,6 +85,7 @@ describe('@regex', () => {
8285 [ punctuation , false ] ,
8386 [ whitespace , false ] ,
8487 [ cronTest , false ] ,
88+ [ macAddress1 , false ] ,
8589 ] . forEach ( ( [ string , result ] ) =>
8690 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
8791 expect ( alphanum . test ( string ) ) . toBe ( result ) ) ,
@@ -103,6 +107,7 @@ describe('@regex', () => {
103107 [ punctuation , false ] ,
104108 [ whitespace , false ] ,
105109 [ cronTest , false ] ,
110+ [ macAddress1 , false ] ,
106111 ] . forEach ( ( [ string , result ] ) =>
107112 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
108113 expect ( alphanumdash . test ( string ) ) . toBe ( result ) ) ,
@@ -124,6 +129,7 @@ describe('@regex', () => {
124129 [ punctuation , false ] ,
125130 [ whitespace , false ] ,
126131 [ cronTest , false ] ,
132+ [ macAddress1 , false ] ,
127133 ] . forEach ( ( [ string , result ] ) =>
128134 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
129135 expect ( alphanumdashdots . test ( string ) ) . toBe ( result ) ) ,
@@ -145,6 +151,7 @@ describe('@regex', () => {
145151 [ punctuation , false ] ,
146152 [ whitespace , false ] ,
147153 [ cronTest , false ] ,
154+ [ macAddress1 , false ] ,
148155 ] . forEach ( ( [ string , result ] ) =>
149156 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
150157 expect ( alphanumdashdotsorempty . test ( string ) ) . toBe ( result ) ) ,
@@ -166,6 +173,7 @@ describe('@regex', () => {
166173 [ punctuation , false ] ,
167174 [ whitespace , true ] ,
168175 [ cronTest , false ] ,
176+ [ macAddress1 , false ] ,
169177 ] . forEach ( ( [ string , result ] ) =>
170178 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
171179 expect ( alphanumdashdotsspaces . test ( string ) ) . toBe ( result ) ) ,
@@ -187,6 +195,7 @@ describe('@regex', () => {
187195 [ punctuation , false ] ,
188196 [ whitespace , false ] ,
189197 [ cronTest , false ] ,
198+ [ macAddress1 , false ] ,
190199 ] . forEach ( ( [ string , result ] ) =>
191200 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
192201 expect ( alphanumdashorempty . test ( string ) ) . toBe ( result ) ) ,
@@ -208,6 +217,7 @@ describe('@regex', () => {
208217 [ punctuation , false ] ,
209218 [ whitespace , true ] ,
210219 [ cronTest , false ] ,
220+ [ macAddress1 , false ] ,
211221 ] . forEach ( ( [ string , result ] ) =>
212222 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
213223 expect ( alphanumdashspaces . test ( string ) ) . toBe ( result ) ) ,
@@ -229,6 +239,7 @@ describe('@regex', () => {
229239 [ punctuation , false ] ,
230240 [ whitespace , false ] ,
231241 [ cronTest , false ] ,
242+ [ macAddress1 , false ] ,
232243 ] . forEach ( ( [ string , result ] ) =>
233244 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
234245 expect ( alphanumdots . test ( string ) ) . toBe ( result ) ) ,
@@ -248,6 +259,7 @@ describe('@regex', () => {
248259 [ punctuation , false ] ,
249260 [ whitespace , false ] ,
250261 [ cronTest , false ] ,
262+ [ macAddress1 , false ] ,
251263 ] . forEach ( ( [ string , result ] ) =>
252264 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
253265 expect ( alphanumLowercase . test ( string ) ) . toBe ( result ) ) ,
@@ -267,6 +279,7 @@ describe('@regex', () => {
267279 [ punctuation , false ] ,
268280 [ whitespace , true ] ,
269281 [ cronTest , false ] ,
282+ [ macAddress1 , false ] ,
270283 ] . forEach ( ( [ string , result ] ) =>
271284 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
272285 expect ( alphanumSpacesDotsUnderscoreDash . test ( string ) ) . toBe ( result ) ) ,
@@ -286,6 +299,7 @@ describe('@regex', () => {
286299 [ punctuation , false ] ,
287300 [ whitespace , false ] ,
288301 [ cronTest , false ] ,
302+ [ macAddress1 , false ] ,
289303 ] . forEach ( ( [ string , result ] ) =>
290304 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
291305 expect ( alphanumUnderscoreDash . test ( string ) ) . toBe ( result ) ) ,
@@ -305,6 +319,7 @@ describe('@regex', () => {
305319 [ punctuation , false ] ,
306320 [ whitespace , false ] ,
307321 [ cronTest , false ] ,
322+ [ macAddress1 , false ] ,
308323 ] . forEach ( ( [ string , result ] ) =>
309324 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
310325 expect ( alphanumUnderscoreDollarDash . test ( string ) ) . toBe ( result ) ) ,
@@ -344,6 +359,7 @@ describe('@regex', () => {
344359 [ punctuation , false ] ,
345360 [ whitespace , false ] ,
346361 [ cronTest , false ] ,
362+ [ macAddress1 , false ] ,
347363 ] . forEach ( ( [ string , result ] ) =>
348364 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
349365 expect ( backupKey . test ( string ) ) . toBe ( result ) ) ,
@@ -382,6 +398,7 @@ describe('@regex', () => {
382398 [ punctuation , false ] ,
383399 [ whitespace , false ] ,
384400 [ cronTest , false ] ,
401+ [ macAddress1 , false ] ,
385402 ] . forEach ( ( [ string , result ] ) =>
386403 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
387404 expect ( digits . test ( string ) ) . toBe ( result ) ) ,
@@ -401,6 +418,7 @@ describe('@regex', () => {
401418 [ punctuation , false ] ,
402419 [ whitespace , false ] ,
403420 [ cronTest , false ] ,
421+ [ macAddress1 , false ] ,
404422 ] . forEach ( ( [ string , result ] ) =>
405423 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
406424 expect ( email . test ( string ) ) . toBe ( result ) ) ,
@@ -421,12 +439,34 @@ describe('@regex', () => {
421439 [ punctuation , false ] ,
422440 [ whitespace , false ] ,
423441 [ cronTest , false ] ,
442+ [ macAddress1 , false ] ,
424443 ] . forEach ( ( [ string , result ] ) =>
425444 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
426445 expect ( fourDigitsCode . test ( string ) ) . toBe ( result ) ) ,
427446 )
428447 } )
429448
449+ describe ( 'macAddress' , ( ) => {
450+ ; [
451+ [ asciiLetters , false ] ,
452+ [ asciiLowercase , false ] ,
453+ [ asciiUppercase , false ] ,
454+ [ digitsTest , false ] ,
455+ [ emailTest , false ] ,
456+ [ octdigits , false ] ,
457+ [ fourDigitsTest , false ] ,
458+ [ hexdigits , false ] ,
459+ [ printable , false ] ,
460+ [ punctuation , false ] ,
461+ [ whitespace , false ] ,
462+ [ cronTest , false ] ,
463+ [ macAddress1 , true ] ,
464+ ] . forEach ( ( [ string , result ] ) =>
465+ it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
466+ expect ( macAddress . test ( string ) ) . toBe ( result ) ) ,
467+ )
468+ } )
469+
430470 describe ( 'phone' , ( ) => {
431471 ; [
432472 [ asciiLetters , false ] ,
@@ -442,6 +482,7 @@ describe('@regex', () => {
442482 [ punctuation , false ] ,
443483 [ whitespace , false ] ,
444484 [ cronTest , false ] ,
485+ [ macAddress1 , false ] ,
445486 ] . forEach ( ( [ string , result ] ) =>
446487 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
447488 expect ( phone . test ( string ) ) . toBe ( result ) ) ,
@@ -463,6 +504,7 @@ describe('@regex', () => {
463504 [ punctuation , false ] ,
464505 [ whitespace , true ] ,
465506 [ cronTest , false ] ,
507+ [ macAddress1 , false ] ,
466508 ] . forEach ( ( [ string , result ] ) =>
467509 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
468510 expect ( spaces . test ( string ) ) . toBe ( result ) ) ,
@@ -485,6 +527,7 @@ describe('@regex', () => {
485527 [ punctuation , false ] ,
486528 [ whitespace , false ] ,
487529 [ cronTest , false ] ,
530+ [ macAddress1 , false ] ,
488531 ] . forEach ( ( [ string , result ] ) =>
489532 it ( `should match regex ${ string } to be ${ result } ` , ( ) =>
490533 expect ( sixDigitsCode . test ( string ) ) . toBe ( result ) ) ,
@@ -507,6 +550,7 @@ describe('@regex', () => {
507550 [ punctuation , false ] ,
508551 [ whitespace , false ] ,
509552 [ cronTest , false ] ,
553+ [ macAddress1 , false ] ,
510554 [ url1 , true ] ,
511555 [ url2 , true ] ,
512556 ] . forEach ( ( [ string , result ] ) =>
0 commit comments