mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -10,22 +10,23 @@ encodings_table.forEach(function(section) {
|
|||
return encoding.name !== 'replacement';
|
||||
}).forEach(function(encoding) {
|
||||
encoding.labels.forEach(function(label) {
|
||||
const textDecoderName = encoding.name.toLowerCase(); // ASCII names only, so safe
|
||||
test(function(t) {
|
||||
assert_equals(
|
||||
new TextDecoder(label).encoding, encoding.name,
|
||||
new TextDecoder(label).encoding, textDecoderName,
|
||||
'label for encoding should match');
|
||||
assert_equals(
|
||||
new TextDecoder(label.toUpperCase()).encoding, encoding.name,
|
||||
new TextDecoder(label.toUpperCase()).encoding, textDecoderName,
|
||||
'label matching should be case-insensitive');
|
||||
whitespace.forEach(function(ws) {
|
||||
assert_equals(
|
||||
new TextDecoder(ws + label).encoding, encoding.name,
|
||||
new TextDecoder(ws + label).encoding, textDecoderName,
|
||||
'label for encoding with leading whitespace should match');
|
||||
assert_equals(
|
||||
new TextDecoder(label + ws).encoding, encoding.name,
|
||||
new TextDecoder(label + ws).encoding, textDecoderName,
|
||||
'label for encoding with trailing whitespace should match');
|
||||
assert_equals(
|
||||
new TextDecoder(ws + label + ws).encoding, encoding.name,
|
||||
new TextDecoder(ws + label + ws).encoding, textDecoderName,
|
||||
'label for encoding with surrounding whitespace should match');
|
||||
});
|
||||
}, label + ' => ' + encoding.name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue