Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made JS Expected output comments consistent with actual output #2879

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 €"
1 change: 1 addition & 0 deletions live-examples/js-examples/classes/classes-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ClassWithStaticMethod {
console.log('Class static initialization block called');
}
}
// Expected output: "Class static initialization block called"

console.log(ClassWithStaticMethod.staticProperty);
// Expected output: "someValue"
Expand Down
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 ₽"

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 €"

// 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"
}
8 changes: 4 additions & 4 deletions live-examples/js-examples/json/json-stringify.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
console.log(JSON.stringify({ x: 5, y: 6 }));
// Expected output: '{"x":5,"y":6}'
// Expected output: "{"x":5,"y":6}"

console.log(
JSON.stringify([new Number(3), new String('false'), new Boolean(false)]),
);
// Expected output: '[3,"false",false]'
// Expected output: "[3,"false",false]"

console.log(JSON.stringify({ x: [10, undefined, function () {}, Symbol('')] }));
// Expected output: '{"x":[10,null,null,null]}'
// Expected output: "{"x":[10,null,null,null]}"

console.log(JSON.stringify(new Date(2006, 0, 2, 15, 4, 5)));
// Expected output: '"2006-01-02T15:04:05.000Z"'
// Expected output: ""2006-01-02T15:04:05.000Z""
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ console.log(eArabic('123456.789'));
// Expected output: "123456.789"

console.log(eArabic(NaN));
// Expected output: "ليس رقم"
// Expected output: "ليس رقم"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ const proxy1 = new Proxy(monster1, handler1);

for (const key of Object.keys(proxy1)) {
console.log(key);
// Expected output: "_age"
// Expected output: "eyeCount"
}
// Expected output: "_age"
// Expected output: "eyeCount"
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."
4 changes: 2 additions & 2 deletions live-examples/js-examples/set/set-prototype-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set1.add(13);

for (const item of set1) {
console.log(item);
// Expected output: 42
// Expected output: 13
}
// Expected output: 42
// Expected output: 13
4 changes: 2 additions & 2 deletions live-examples/js-examples/set/set-prototype-entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const iterator1 = set1.entries();

for (const entry of iterator1) {
console.log(entry);
// Expected output: Array [42, 42]
// Expected output: Array ["forty two", "forty two"]
}
// Expected output: Array [42, 42]
// Expected output: Array ["forty two", "forty two"]
2 changes: 1 addition & 1 deletion live-examples/js-examples/string/string-fromcodepoint.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
console.log(String.fromCodePoint(9731, 9733, 9842, 0x2f804));
// Expected output: "☃★♲"
// Expected output: "☃★♲你"
2 changes: 1 addition & 1 deletion live-examples/js-examples/string/string-lastindexof.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const paragraph = "I think Ruth's dog is cuter than your dog!";
const searchTerm = 'dog';

console.log(
`Index of the last ${searchTerm} is ${paragraph.lastIndexOf(searchTerm)}`,
`Index of the last "${searchTerm}" is ${paragraph.lastIndexOf(searchTerm)}`,
);
// Expected output: "Index of the last "dog" is 38"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const dotted = 'İstanbul';

console.log(`EN-US: ${dotted.toLocaleLowerCase('en-US')}`);
// Expected output: "i̇stanbul"
// Expected output: "EN-US: i̇stanbul"

console.log(`TR: ${dotted.toLocaleLowerCase('tr')}`);
// Expected output: "istanbul"
// Expected output: "TR: istanbul"
4 changes: 2 additions & 2 deletions live-examples/js-examples/string/string-trimend.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const greeting = ' Hello world! ';

console.log(greeting);
// Expected output: " Hello world! ";
// Expected output: " Hello world! "

console.log(greeting.trimEnd());
// Expected output: " Hello world!";
// Expected output: " Hello world!"
4 changes: 2 additions & 2 deletions live-examples/js-examples/string/string-trimstart.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const greeting = ' Hello world! ';

console.log(greeting);
// Expected output: " Hello world! ";
// Expected output: " Hello world! "

console.log(greeting.trimStart());
// Expected output: "Hello world! ";
// Expected output: "Hello world! "
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ console.log(Symbol('desc').toString());
// Expected output: "Symbol(desc)"

console.log(Symbol.iterator.toString());
// Expected output: "Symbol(Symbol.iterator)
// Expected output: "Symbol(Symbol.iterator)"

console.log(Symbol.for('foo').toString());
// Expected output: "Symbol(foo)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ function isNegative(element /*, index, array */) {

const int8 = new Int8Array([10, 0, -10, 20, -30, 40, 50]);

console.log(int8.find(isNegative));
console.log(int8.findLast(isNegative));
// Expected output: -30
Loading