Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,33 @@
// META: title=Encoding API: Encoding labels
// META: script=resources/encodings.js
// META: timeout=long
var whitespace = [' ', '\t', '\n', '\f', '\r'];
encodings_table.forEach(function(section) {
section.encodings.filter(function(encoding) {
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, textDecoderName,
'label for encoding should match');
assert_equals(
new TextDecoder(label.toUpperCase()).encoding, textDecoderName,
'label matching should be case-insensitive');
whitespace.forEach(function(ws) {
assert_equals(
new TextDecoder(ws + label).encoding, textDecoderName,
'label for encoding with leading whitespace should match');
assert_equals(
new TextDecoder(label + ws).encoding, textDecoderName,
'label for encoding with trailing whitespace should match');
assert_equals(
new TextDecoder(ws + label + ws).encoding, textDecoderName,
'label for encoding with surrounding whitespace should match');
});
}, label + ' => ' + encoding.name);
});
});
});