Update Intl.Locale info API test

weekendStart / weekendEnd are merged into one weekend array.
This commit is contained in:
Yusuke Suzuki 2021-11-14 00:44:30 -08:00 committed by Rick Waldron
parent c124f6c037
commit fc6a9169a4
1 changed files with 8 additions and 13 deletions

View File

@ -1,4 +1,5 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// Copyright 2021 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
@ -28,7 +29,7 @@ function isIntegerBetweenOneAndSeven(value) {
return value === 1 || value === 2 || value === 3 || value === 4 || value === 5 || value === 6 || value === 7;
}
assert.compareArray(Reflect.ownKeys(result), ['firstDay', 'weekendStart', 'weekendEnd', 'minimalDays']);
assert.compareArray(Reflect.ownKeys(result), ['firstDay', 'weekend', 'minimalDays']);
verifyProperty(result, 'firstDay', {
writable: true,
@ -40,25 +41,19 @@ assert(
'`firstDay` must be an integer between one and seven (inclusive)'
);
verifyProperty(result, 'weekendStart', {
verifyProperty(result, 'weekend', {
writable: true,
enumerable: true,
configurable: true
});
assert(
isIntegerBetweenOneAndSeven(new Intl.Locale('en').weekInfo.weekendStart),
'`weekendStart` must be an integer between one and seven (inclusive)'
new Intl.Locale('en').weekInfo.weekend.every(isIntegerBetweenOneAndSeven),
'`weekend` must include integers between one and seven (inclusive)'
);
verifyProperty(result, 'weekendEnd', {
writable: true,
enumerable: true,
configurable: true
});
assert(
isIntegerBetweenOneAndSeven(new Intl.Locale('en').weekInfo.weekendEnd),
'`weekendEnd` must be an integer between one and seven (inclusive)'
);
let original = new Intl.Locale('en').weekInfo.weekend;
let sorted = original.slice().sort();
assert.compareArray(original, sorted);
verifyProperty(result, 'minimalDays', {
writable: true,