Skip to content

Commit

Permalink
Skip bad ToUnicode tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyGu authored and Sebmaster committed Sep 3, 2017
1 parent e810c4d commit 335023f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/unicode.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function testConversionOption(test, option) {
}

function testConversion(test) {
return () => {
return function () {
if (test[0] === "B" || test[0] === "N") {
testConversionOption(test, "nontransitional");
}
Expand All @@ -54,6 +54,16 @@ function testConversion(test) {
testConversionOption(test, "transitional");
}

// If the ToUnicode error code is [A4_2], it means that the test is buggy. See
// https://github.com/Sebmaster/tr46.js/pull/13#issuecomment-318874337.

// The `this.skip()` line below will show the entire test is skipped in Mocha's output, but in fact toASCII is still
// tested above (and an error will be thrown if toASCII breaks).
if (test[2].trim() === "[A4_2]") {
this.skip(); // eslint-disable-line no-invalid-this
return;
}

// ToUnicode is always non-transitional.
const res = tr46.toUnicode(test[1], {
checkHyphens: true,
Expand Down

0 comments on commit 335023f

Please sign in to comment.