Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444

This commit is contained in:
Josh Matthews 2017-04-17 12:06:02 +10:00 committed by Anthony Ramine
parent 25e8bf69e6
commit 665817d2a6
35333 changed files with 1818077 additions and 16036 deletions

View file

@ -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);