mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 06:25:30 +02:00
Avoid excessive U+
in error messages
This commit is contained in:
parent
63e0986803
commit
1a352aac50
@ -51,10 +51,10 @@ function printStringCodePoints(string) {
|
|||||||
function testPropertyEscapes(regExp, string, expression) {
|
function testPropertyEscapes(regExp, string, expression) {
|
||||||
if (!regExp.test(string)) {
|
if (!regExp.test(string)) {
|
||||||
for (const symbol of string) {
|
for (const symbol of string) {
|
||||||
const hex = printCodePoint(symbol.codePointAt(0));
|
const formatted = printCodePoint(symbol.codePointAt(0));
|
||||||
assert(
|
assert(
|
||||||
regExp.test(symbol),
|
regExp.test(symbol),
|
||||||
`\`${ expression }\` should match U+${ hex } (\`${ symbol }\`)`
|
`\`${ expression }\` should match ${ formatted } (\`${ symbol }\`)`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ function testPropertyOfStrings(args) {
|
|||||||
for (const string of matchStrings) {
|
for (const string of matchStrings) {
|
||||||
assert(
|
assert(
|
||||||
regExp.test(string),
|
regExp.test(string),
|
||||||
`\`${ expression }\` should match ${ string } (U+${ printStringCodePoints(string) })`
|
`\`${ expression }\` should match ${ string } (${ printStringCodePoints(string) })`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ function testPropertyOfStrings(args) {
|
|||||||
for (const string of nonMatchStrings) {
|
for (const string of nonMatchStrings) {
|
||||||
assert(
|
assert(
|
||||||
!regExp.test(string),
|
!regExp.test(string),
|
||||||
`\`${ expression }\` should not match ${ string } (U+${ printStringCodePoints(string) })`
|
`\`${ expression }\` should not match ${ string } (${ printStringCodePoints(string) })`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user