From 8005ce5a4b104aa1603bb862d2947fb59ba6f8a8 Mon Sep 17 00:00:00 2001 From: Alex Gordon Date: Sat, 14 Dec 2024 00:35:54 +0000 Subject: [PATCH] Made JS example Expected output comments consistent with console output --- live-examples/js-examples/bigint/bigint-tolocalestring.js | 2 +- live-examples/js-examples/globalprops/globalprops-isfinite.js | 2 +- .../intl/intl-datetimeformat-prototype-formattoparts.js | 2 +- live-examples/js-examples/intl/intl-getcanonicallocales.js | 4 ++-- .../intl/intl-listformat-prototype-formattoparts.js | 4 ++-- .../intl/intl-listformat-prototype-resolvedoptions.js | 3 +-- .../js-examples/intl/intl-numberformat-prototype-format.js | 2 +- .../intl/intl-numberformat-prototype-formattoparts.js | 2 +- .../intl/intl-numberformat-prototype-resolvedoptions.js | 3 +-- live-examples/js-examples/intl/intl-numberformat.js | 2 +- live-examples/js-examples/intl/intl-segmenter.js | 4 ++-- live-examples/js-examples/intl/intl-supportedvaluesof.js | 2 +- live-examples/js-examples/regexp/regexp-character-classes.js | 4 ++-- live-examples/js-examples/regexp/regexp-prototype-exec.js | 4 ++-- 14 files changed, 19 insertions(+), 21 deletions(-) diff --git a/live-examples/js-examples/bigint/bigint-tolocalestring.js b/live-examples/js-examples/bigint/bigint-tolocalestring.js index bc906d378..b3113ef8e 100644 --- a/live-examples/js-examples/bigint/bigint-tolocalestring.js +++ b/live-examples/js-examples/bigint/bigint-tolocalestring.js @@ -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 €" diff --git a/live-examples/js-examples/globalprops/globalprops-isfinite.js b/live-examples/js-examples/globalprops/globalprops-isfinite.js index 3770272fe..f90cac8f8 100644 --- a/live-examples/js-examples/globalprops/globalprops-isfinite.js +++ b/live-examples/js-examples/globalprops/globalprops-isfinite.js @@ -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." diff --git a/live-examples/js-examples/intl/intl-datetimeformat-prototype-formattoparts.js b/live-examples/js-examples/intl/intl-datetimeformat-prototype-formattoparts.js index 20f9c3930..423e39d1e 100644 --- a/live-examples/js-examples/intl/intl-datetimeformat-prototype-formattoparts.js +++ b/live-examples/js-examples/intl/intl-datetimeformat-prototype-formattoparts.js @@ -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"] diff --git a/live-examples/js-examples/intl/intl-getcanonicallocales.js b/live-examples/js-examples/intl/intl-getcanonicallocales.js index 51b55d40d..c6cf3b009 100644 --- a/live-examples/js-examples/intl/intl-getcanonicallocales.js +++ b/live-examples/js-examples/intl/intl-getcanonicallocales.js @@ -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" } diff --git a/live-examples/js-examples/intl/intl-listformat-prototype-formattoparts.js b/live-examples/js-examples/intl/intl-listformat-prototype-formattoparts.js index 4bf676ca9..8b8fb3288 100644 --- a/live-examples/js-examples/intl/intl-listformat-prototype-formattoparts.js +++ b/live-examples/js-examples/intl/intl-listformat-prototype-formattoparts.js @@ -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"] diff --git a/live-examples/js-examples/intl/intl-listformat-prototype-resolvedoptions.js b/live-examples/js-examples/intl/intl-listformat-prototype-resolvedoptions.js index 7cfc7fe3a..b07521fae 100644 --- a/live-examples/js-examples/intl/intl-listformat-prototype-resolvedoptions.js +++ b/live-examples/js-examples/intl/intl-listformat-prototype-resolvedoptions.js @@ -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" diff --git a/live-examples/js-examples/intl/intl-numberformat-prototype-format.js b/live-examples/js-examples/intl/intl-numberformat-prototype-format.js index 8a0d99fc8..51bcadd09 100644 --- a/live-examples/js-examples/intl/intl-numberformat-prototype-format.js +++ b/live-examples/js-examples/intl/intl-numberformat-prototype-format.js @@ -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 ₽" const options2 = { style: 'currency', currency: 'USD' }; const numberFormat2 = new Intl.NumberFormat('en-US', options2); diff --git a/live-examples/js-examples/intl/intl-numberformat-prototype-formattoparts.js b/live-examples/js-examples/intl/intl-numberformat-prototype-formattoparts.js index 2ce304f83..0589239cf 100644 --- a/live-examples/js-examples/intl/intl-numberformat-prototype-formattoparts.js +++ b/live-examples/js-examples/intl/intl-numberformat-prototype-formattoparts.js @@ -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"] diff --git a/live-examples/js-examples/intl/intl-numberformat-prototype-resolvedoptions.js b/live-examples/js-examples/intl/intl-numberformat-prototype-resolvedoptions.js index 659726cdf..24ae42bde 100644 --- a/live-examples/js-examples/intl/intl-numberformat-prototype-resolvedoptions.js +++ b/live-examples/js-examples/intl/intl-numberformat-prototype-resolvedoptions.js @@ -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" diff --git a/live-examples/js-examples/intl/intl-numberformat.js b/live-examples/js-examples/intl/intl-numberformat.js index e5252a0ea..2e9119dfb 100644 --- a/live-examples/js-examples/intl/intl-numberformat.js +++ b/live-examples/js-examples/intl/intl-numberformat.js @@ -5,7 +5,7 @@ console.log( number, ), ); -// Expected output: "123.456,79 €" +// Expected output: "123.456,79 €" // The Japanese yen doesn't use a minor unit console.log( diff --git a/live-examples/js-examples/intl/intl-segmenter.js b/live-examples/js-examples/intl/intl-segmenter.js index 2dabdadfb..34c8d94da 100644 --- a/live-examples/js-examples/intl/intl-segmenter.js +++ b/live-examples/js-examples/intl/intl-segmenter.js @@ -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: " " diff --git a/live-examples/js-examples/intl/intl-supportedvaluesof.js b/live-examples/js-examples/intl/intl-supportedvaluesof.js index f6b3fd8d4..d16b654da 100644 --- a/live-examples/js-examples/intl/intl-supportedvaluesof.js +++ b/live-examples/js-examples/intl/intl-supportedvaluesof.js @@ -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" } diff --git a/live-examples/js-examples/regexp/regexp-character-classes.js b/live-examples/js-examples/regexp/regexp-character-classes.js index 9241713bc..7570ac848 100644 --- a/live-examples/js-examples/regexp/regexp-character-classes.js +++ b/live-examples/js-examples/regexp/regexp-character-classes.js @@ -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 ["🙂", "😕", "😢"] diff --git a/live-examples/js-examples/regexp/regexp-prototype-exec.js b/live-examples/js-examples/regexp/regexp-prototype-exec.js index 678dc1acb..d9e374a26 100644 --- a/live-examples/js-examples/regexp/regexp-prototype-exec.js +++ b/live-examples/js-examples/regexp/regexp-prototype-exec.js @@ -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."