Skip to content

Commit

Permalink
Made JS example Expected output comments consistent with console output
Browse files Browse the repository at this point in the history
  • Loading branch information
atg committed Dec 14, 2024
1 parent 7bf1643 commit 8005ce5
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion live-examples/js-examples/bigint/bigint-tolocalestring.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ console.log(bigint.toLocaleString('de-DE'));
console.log(
bigint.toLocaleString('de-DE', { style: 'currency', currency: 'EUR' }),
);
// Expected output: "123.456.789.123.456.789,00 €"
// Expected output: "123.456.789.123.456.789,00 €"

Check failure on line 11 in live-examples/js-examples/bigint/bigint-tolocalestring.js

View workflow job for this annotation

GitHub Actions / build

Irregular whitespace not allowed
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function div(x) {
}

console.log(div(0));
// Expected output: "Number is Infinity!""
// Expected output: "Number is Infinity!"

console.log(div(1));
// Expected output: "Number is NOT Infinity."
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ const parts = dateTimeFormat.formatToParts(date);
const partValues = parts.map((p) => p.value);

console.log(partValues);
// Expected output: "["Friday", ", ", "June", " ", "1", ", ", "2012"]"
// Expected output: Array ["Friday", ", ", "June", " ", "1", ", ", "2012"]
4 changes: 2 additions & 2 deletions live-examples/js-examples/intl/intl-getcanonicallocales.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ try {
Intl.getCanonicalLocales('EN_US');
} catch (err) {
console.log(err.toString());
// Expected output (Firefox/Safari): RangeError: invalid language tag: "EN_US"
// Expected output (Chrome): RangeError: Incorrect locale information provided
// Expected output (Firefox/Safari): "RangeError: invalid language tag: "EN_US""
// Expected output (Chrome): "RangeError: Incorrect locale information provided"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ const partValuesEn = formatterEn.formatToParts(vehicles).map((p) => p.value);
const partValuesFr = formatterFr.formatToParts(vehicles).map((p) => p.value);

console.log(partValuesEn);
// Expected output: "["Motorcycle", ", ", "Bus", ", and ", "Car"]"
// Expected output: Array ["Motorcycle", ", ", "Bus", ", and ", "Car"]
console.log(partValuesFr);
// Expected output: "["Motorcycle", ", ", "Bus", " et ", "Car"]"
// Expected output: Array ["Motorcycle", ", ", "Bus", " et ", "Car"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const deListFormatter1 = new Intl.ListFormat('de-DE', { type: 'disjunction' });
const options1 = deListFormatter1.resolvedOptions();

console.log(options1.locale);
// Expected output (Firefox / Safari): "de-DE"
// Expected output (Chrome): "de"
// Expected output: "de-DE"

console.log(options1.style);
// Expected output: "long"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const options1 = { style: 'currency', currency: 'RUB' };
const numberFormat1 = new Intl.NumberFormat('ru-RU', options1);

console.log(numberFormat1.format(amount));
// Expected output: "654 321,99 ₽"
// Expected output: "654 321,99 ₽"

Check failure on line 7 in live-examples/js-examples/intl/intl-numberformat-prototype-format.js

View workflow job for this annotation

GitHub Actions / build

Irregular whitespace not allowed

Check failure on line 7 in live-examples/js-examples/intl/intl-numberformat-prototype-format.js

View workflow job for this annotation

GitHub Actions / build

Irregular whitespace not allowed

const options2 = { style: 'currency', currency: 'USD' };
const numberFormat2 = new Intl.NumberFormat('en-US', options2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const parts = numberFormat.formatToParts(amount);
const partValues = parts.map((p) => p.value);

console.log(partValues);
// Expected output: "["$", "654", ",", "321", ".", "99"]"
// Expected output: Array ["$", "654", ",", "321", ".", "99"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const numberFormat1 = new Intl.NumberFormat('de-DE');
const options1 = numberFormat1.resolvedOptions();

console.log(options1.locale);
// Expected output (Firefox / Safari): "de-DE"
// Expected output (Chrome): "de"
// Expected output: "de-DE"

console.log(options1.numberingSystem);
// Expected output: "latn"
Expand Down
2 changes: 1 addition & 1 deletion live-examples/js-examples/intl/intl-numberformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ console.log(
number,
),
);
// Expected output: "123.456,79 €"
// Expected output: "123.456,79 €"

Check failure on line 8 in live-examples/js-examples/intl/intl-numberformat.js

View workflow job for this annotation

GitHub Actions / build

Irregular whitespace not allowed

// The Japanese yen doesn't use a minor unit
console.log(
Expand Down
4 changes: 2 additions & 2 deletions live-examples/js-examples/intl/intl-segmenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const string1 = 'Que ma joie demeure';
const iterator1 = segmenterFr.segment(string1)[Symbol.iterator]();

console.log(iterator1.next().value.segment);
// Expected output: 'Que'
// Expected output: "Que"

console.log(iterator1.next().value.segment);
// Expected output: ' '
// Expected output: " "
2 changes: 1 addition & 1 deletion live-examples/js-examples/intl/intl-supportedvaluesof.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ try {
Intl.supportedValuesOf('someInvalidKey');
} catch (err) {
console.log(err.toString());
// Expected output: RangeError: invalid key: "someInvalidKey"
// Expected output: "RangeError: Invalid key : someInvalidKey"
}
4 changes: 2 additions & 2 deletions live-examples/js-examples/regexp/regexp-character-classes.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const chessStory = 'He played the King in a8 and she moved her Queen in c2.';
const regexpCoordinates = /\w\d/g;
console.log(chessStory.match(regexpCoordinates));
// Expected output: Array [ 'a8', 'c2']
// Expected output: Array ["a8", "c2"]

const moods = 'happy 🙂, confused 😕, sad 😢';
const regexpEmoticons = /[\u{1F600}-\u{1F64F}]/gu;
console.log(moods.match(regexpEmoticons));
// Expected output: Array ['🙂', '😕', '😢']
// Expected output: Array ["🙂", "😕", "😢"]
4 changes: 2 additions & 2 deletions live-examples/js-examples/regexp/regexp-prototype-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ let array1;

while ((array1 = regex1.exec(str1)) !== null) {
console.log(`Found ${array1[0]}. Next starts at ${regex1.lastIndex}.`);
// Expected output: "Found foo. Next starts at 9."
// Expected output: "Found foo. Next starts at 19."
}
// Expected output: "Found foo. Next starts at 9."
// Expected output: "Found foo. Next starts at 19."

0 comments on commit 8005ce5

Please sign in to comment.