Skip to content

Commit cd1a4ba

Browse files
committed
Add test for #115
1 parent 73a3fe4 commit cd1a4ba

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

punycode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ const decode = function(input) {
236236
}
237237

238238
const digit = basicToDigit(input.charCodeAt(index++));
239-
239+
240240
if (digit >= base) {
241241
error('invalid-input');
242242
}

tests/tests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ const testData = {
212212
'description': 'Email address',
213213
'decoded': '\u0434\u0436\u0443\u043C\u043B\u0430@\u0434\u0436p\u0443\u043C\u043B\u0430\u0442\u0435\u0441\u0442.b\u0440\u0444a',
214214
'encoded': '\u0434\u0436\u0443\u043C\u043B\[email protected]'
215+
},
216+
{ // https://github.com/mathiasbynens/punycode.js/pull/115
217+
'decoded': 'foo\x7F.example',
218+
'encoded': 'foo\x7F.example'
215219
}
216220
],
217221
'separators': [

0 commit comments

Comments
 (0)