Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add branding tests from Temporal #3138

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/built-ins/Temporal/Calendar/prototype/dateAdd/branding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.dateadd
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const dateAdd = Temporal.Calendar.prototype.dateAdd;

assert.sameValue(typeof dateAdd, "function");

assert.throws(TypeError, () => dateAdd.call(undefined), "undefined");
assert.throws(TypeError, () => dateAdd.call(null), "null");
assert.throws(TypeError, () => dateAdd.call(true), "true");
assert.throws(TypeError, () => dateAdd.call(""), "empty string");
assert.throws(TypeError, () => dateAdd.call(Symbol()), "symbol");
assert.throws(TypeError, () => dateAdd.call(1), "1");
assert.throws(TypeError, () => dateAdd.call({}), "plain object");
assert.throws(TypeError, () => dateAdd.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => dateAdd.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.datefromfields
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const dateFromFields = Temporal.Calendar.prototype.dateFromFields;

assert.sameValue(typeof dateFromFields, "function");

assert.throws(TypeError, () => dateFromFields.call(undefined), "undefined");
assert.throws(TypeError, () => dateFromFields.call(null), "null");
assert.throws(TypeError, () => dateFromFields.call(true), "true");
assert.throws(TypeError, () => dateFromFields.call(""), "empty string");
assert.throws(TypeError, () => dateFromFields.call(Symbol()), "symbol");
assert.throws(TypeError, () => dateFromFields.call(1), "1");
assert.throws(TypeError, () => dateFromFields.call({}), "plain object");
assert.throws(TypeError, () => dateFromFields.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => dateFromFields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.dateuntil
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const dateUntil = Temporal.Calendar.prototype.dateUntil;

assert.sameValue(typeof dateUntil, "function");

assert.throws(TypeError, () => dateUntil.call(undefined), "undefined");
assert.throws(TypeError, () => dateUntil.call(null), "null");
assert.throws(TypeError, () => dateUntil.call(true), "true");
assert.throws(TypeError, () => dateUntil.call(""), "empty string");
assert.throws(TypeError, () => dateUntil.call(Symbol()), "symbol");
assert.throws(TypeError, () => dateUntil.call(1), "1");
assert.throws(TypeError, () => dateUntil.call({}), "plain object");
assert.throws(TypeError, () => dateUntil.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => dateUntil.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
22 changes: 22 additions & 0 deletions test/built-ins/Temporal/Calendar/prototype/day/branding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.day
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const day = Temporal.Calendar.prototype.day;

assert.sameValue(typeof day, "function");

assert.throws(TypeError, () => day.call(undefined), "undefined");
assert.throws(TypeError, () => day.call(null), "null");
assert.throws(TypeError, () => day.call(true), "true");
assert.throws(TypeError, () => day.call(""), "empty string");
assert.throws(TypeError, () => day.call(Symbol()), "symbol");
assert.throws(TypeError, () => day.call(1), "1");
assert.throws(TypeError, () => day.call({}), "plain object");
assert.throws(TypeError, () => day.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => day.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.dayofweek
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const dayOfWeek = Temporal.Calendar.prototype.dayOfWeek;

assert.sameValue(typeof dayOfWeek, "function");

assert.throws(TypeError, () => dayOfWeek.call(undefined), "undefined");
assert.throws(TypeError, () => dayOfWeek.call(null), "null");
assert.throws(TypeError, () => dayOfWeek.call(true), "true");
assert.throws(TypeError, () => dayOfWeek.call(""), "empty string");
assert.throws(TypeError, () => dayOfWeek.call(Symbol()), "symbol");
assert.throws(TypeError, () => dayOfWeek.call(1), "1");
assert.throws(TypeError, () => dayOfWeek.call({}), "plain object");
assert.throws(TypeError, () => dayOfWeek.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => dayOfWeek.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.dayofyear
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const dayOfYear = Temporal.Calendar.prototype.dayOfYear;

assert.sameValue(typeof dayOfYear, "function");

assert.throws(TypeError, () => dayOfYear.call(undefined), "undefined");
assert.throws(TypeError, () => dayOfYear.call(null), "null");
assert.throws(TypeError, () => dayOfYear.call(true), "true");
assert.throws(TypeError, () => dayOfYear.call(""), "empty string");
assert.throws(TypeError, () => dayOfYear.call(Symbol()), "symbol");
assert.throws(TypeError, () => dayOfYear.call(1), "1");
assert.throws(TypeError, () => dayOfYear.call({}), "plain object");
assert.throws(TypeError, () => dayOfYear.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => dayOfYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.daysinmonth
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const daysInMonth = Temporal.Calendar.prototype.daysInMonth;

assert.sameValue(typeof daysInMonth, "function");

assert.throws(TypeError, () => daysInMonth.call(undefined), "undefined");
assert.throws(TypeError, () => daysInMonth.call(null), "null");
assert.throws(TypeError, () => daysInMonth.call(true), "true");
assert.throws(TypeError, () => daysInMonth.call(""), "empty string");
assert.throws(TypeError, () => daysInMonth.call(Symbol()), "symbol");
assert.throws(TypeError, () => daysInMonth.call(1), "1");
assert.throws(TypeError, () => daysInMonth.call({}), "plain object");
assert.throws(TypeError, () => daysInMonth.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => daysInMonth.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.daysinweek
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const daysInWeek = Temporal.Calendar.prototype.daysInWeek;

assert.sameValue(typeof daysInWeek, "function");

assert.throws(TypeError, () => daysInWeek.call(undefined), "undefined");
assert.throws(TypeError, () => daysInWeek.call(null), "null");
assert.throws(TypeError, () => daysInWeek.call(true), "true");
assert.throws(TypeError, () => daysInWeek.call(""), "empty string");
assert.throws(TypeError, () => daysInWeek.call(Symbol()), "symbol");
assert.throws(TypeError, () => daysInWeek.call(1), "1");
assert.throws(TypeError, () => daysInWeek.call({}), "plain object");
assert.throws(TypeError, () => daysInWeek.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => daysInWeek.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.daysinyear
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const daysInYear = Temporal.Calendar.prototype.daysInYear;

assert.sameValue(typeof daysInYear, "function");

assert.throws(TypeError, () => daysInYear.call(undefined), "undefined");
assert.throws(TypeError, () => daysInYear.call(null), "null");
assert.throws(TypeError, () => daysInYear.call(true), "true");
assert.throws(TypeError, () => daysInYear.call(""), "empty string");
assert.throws(TypeError, () => daysInYear.call(Symbol()), "symbol");
assert.throws(TypeError, () => daysInYear.call(1), "1");
assert.throws(TypeError, () => daysInYear.call({}), "plain object");
assert.throws(TypeError, () => daysInYear.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => daysInYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
22 changes: 22 additions & 0 deletions test/built-ins/Temporal/Calendar/prototype/era/branding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.era
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const era = Temporal.Calendar.prototype.era;

assert.sameValue(typeof era, "function");

assert.throws(TypeError, () => era.call(undefined), "undefined");
assert.throws(TypeError, () => era.call(null), "null");
assert.throws(TypeError, () => era.call(true), "true");
assert.throws(TypeError, () => era.call(""), "empty string");
assert.throws(TypeError, () => era.call(Symbol()), "symbol");
assert.throws(TypeError, () => era.call(1), "1");
assert.throws(TypeError, () => era.call({}), "plain object");
assert.throws(TypeError, () => era.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => era.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
22 changes: 22 additions & 0 deletions test/built-ins/Temporal/Calendar/prototype/eraYear/branding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.erayear
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const eraYear = Temporal.Calendar.prototype.eraYear;

assert.sameValue(typeof eraYear, "function");

assert.throws(TypeError, () => eraYear.call(undefined), "undefined");
assert.throws(TypeError, () => eraYear.call(null), "null");
assert.throws(TypeError, () => eraYear.call(true), "true");
assert.throws(TypeError, () => eraYear.call(""), "empty string");
assert.throws(TypeError, () => eraYear.call(Symbol()), "symbol");
assert.throws(TypeError, () => eraYear.call(1), "1");
assert.throws(TypeError, () => eraYear.call({}), "plain object");
assert.throws(TypeError, () => eraYear.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => eraYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
22 changes: 22 additions & 0 deletions test/built-ins/Temporal/Calendar/prototype/fields/branding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.fields
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const fields = Temporal.Calendar.prototype.fields;

assert.sameValue(typeof fields, "function");

assert.throws(TypeError, () => fields.call(undefined), "undefined");
assert.throws(TypeError, () => fields.call(null), "null");
assert.throws(TypeError, () => fields.call(true), "true");
assert.throws(TypeError, () => fields.call(""), "empty string");
assert.throws(TypeError, () => fields.call(Symbol()), "symbol");
assert.throws(TypeError, () => fields.call(1), "1");
assert.throws(TypeError, () => fields.call({}), "plain object");
assert.throws(TypeError, () => fields.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => fields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.inleapyear
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const inLeapYear = Temporal.Calendar.prototype.inLeapYear;

assert.sameValue(typeof inLeapYear, "function");

assert.throws(TypeError, () => inLeapYear.call(undefined), "undefined");
assert.throws(TypeError, () => inLeapYear.call(null), "null");
assert.throws(TypeError, () => inLeapYear.call(true), "true");
assert.throws(TypeError, () => inLeapYear.call(""), "empty string");
assert.throws(TypeError, () => inLeapYear.call(Symbol()), "symbol");
assert.throws(TypeError, () => inLeapYear.call(1), "1");
assert.throws(TypeError, () => inLeapYear.call({}), "plain object");
assert.throws(TypeError, () => inLeapYear.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => inLeapYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.mergefields
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const mergeFields = Temporal.Calendar.prototype.mergeFields;

assert.sameValue(typeof mergeFields, "function");

assert.throws(TypeError, () => mergeFields.call(undefined), "undefined");
assert.throws(TypeError, () => mergeFields.call(null), "null");
assert.throws(TypeError, () => mergeFields.call(true), "true");
assert.throws(TypeError, () => mergeFields.call(""), "empty string");
assert.throws(TypeError, () => mergeFields.call(Symbol()), "symbol");
assert.throws(TypeError, () => mergeFields.call(1), "1");
assert.throws(TypeError, () => mergeFields.call({}), "plain object");
assert.throws(TypeError, () => mergeFields.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => mergeFields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
22 changes: 22 additions & 0 deletions test/built-ins/Temporal/Calendar/prototype/month/branding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.month
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const month = Temporal.Calendar.prototype.month;

assert.sameValue(typeof month, "function");

assert.throws(TypeError, () => month.call(undefined), "undefined");
assert.throws(TypeError, () => month.call(null), "null");
assert.throws(TypeError, () => month.call(true), "true");
assert.throws(TypeError, () => month.call(""), "empty string");
assert.throws(TypeError, () => month.call(Symbol()), "symbol");
assert.throws(TypeError, () => month.call(1), "1");
assert.throws(TypeError, () => month.call({}), "plain object");
assert.throws(TypeError, () => month.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => month.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.monthcode
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const monthCode = Temporal.Calendar.prototype.monthCode;

assert.sameValue(typeof monthCode, "function");

assert.throws(TypeError, () => monthCode.call(undefined), "undefined");
assert.throws(TypeError, () => monthCode.call(null), "null");
assert.throws(TypeError, () => monthCode.call(true), "true");
assert.throws(TypeError, () => monthCode.call(""), "empty string");
assert.throws(TypeError, () => monthCode.call(Symbol()), "symbol");
assert.throws(TypeError, () => monthCode.call(1), "1");
assert.throws(TypeError, () => monthCode.call({}), "plain object");
assert.throws(TypeError, () => monthCode.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => monthCode.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.monthdayfromfields
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/

const monthDayFromFields = Temporal.Calendar.prototype.monthDayFromFields;

assert.sameValue(typeof monthDayFromFields, "function");

assert.throws(TypeError, () => monthDayFromFields.call(undefined), "undefined");
assert.throws(TypeError, () => monthDayFromFields.call(null), "null");
assert.throws(TypeError, () => monthDayFromFields.call(true), "true");
assert.throws(TypeError, () => monthDayFromFields.call(""), "empty string");
assert.throws(TypeError, () => monthDayFromFields.call(Symbol()), "symbol");
assert.throws(TypeError, () => monthDayFromFields.call(1), "1");
assert.throws(TypeError, () => monthDayFromFields.call({}), "plain object");
assert.throws(TypeError, () => monthDayFromFields.call(Temporal.Calendar), "Temporal.Calendar");
assert.throws(TypeError, () => monthDayFromFields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
Loading