Skip to content

Commit

Permalink
added extra tests for mixed alphanumeric
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-allen committed Aug 21, 2023
1 parent 0ccefb9 commit 56b3cef
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/intl402/DisplayNames/prototype/of/type-region-invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var displayNames = new Intl.DisplayNames(undefined, {type: 'region'});

assert.throws(RangeError, function() {
displayNames.of('00');
}, 'insufficient length, digit');
}, 'insufficient length, numeric');

assert.throws(RangeError, function() {
displayNames.of('a');
Expand All @@ -29,12 +29,28 @@ assert.throws(RangeError, function() {

assert.throws(RangeError, function() {
displayNames.of('1111');
}, 'excessive length, digit');
}, 'excessive length, numeric');

assert.throws(RangeError, function() {
displayNames.of('');
}, 'empty string');

assert.throws(RangeError, function() {
displayNames.of('a01');
}, 'mixed alphanumeric (alpha first, length 3)');

assert.throws(RangeError, function() {
displayNames.of('a1');
}, 'mixed alphanumeric (alpha first, length 2)');

assert.throws(RangeError, function() {
displayNames.of('1a');
}, 'mixed alphanumeric (numeric first, length 2)');

assert.throws(RangeError, function() {
displayNames.of('1a1');
}, 'mixed alphanumeric (numeric first, length 3)');

assert.throws(RangeError, function() {
displayNames.of('-111');
}, 'leading separator (dash)');
Expand Down

0 comments on commit 56b3cef

Please sign in to comment.