Skip to content

Commit 433ed8b

Browse files
committed
fix some assert messages and variables names
1 parent 1b20946 commit 433ed8b

15 files changed

+65
-65
lines changed

tests/unit-global/es.string.split.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ const run = assert => {
689689
}
690690
}
691691

692-
assert.throws(() => ''.split.call(Symbol('aplit test'), /./), 'throws on symbol context');
692+
assert.throws(() => ''.split.call(Symbol('split test'), /./), 'throws on symbol context');
693693
};
694694

695695
QUnit.test('String#split regression', run);

tests/unit-global/esnext.map.delete-all.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ QUnit.test('Map#deleteAll', assert => {
88
assert.looksNative(deleteAll);
99
assert.nonEnumerable(Map.prototype, 'deleteAll');
1010

11-
let set = new Map([[1, 2], [2, 3], [3, 4]]);
12-
assert.true(set.deleteAll(1, 2));
13-
assert.deepEqual(from(set), [[3, 4]]);
11+
let map = new Map([[1, 2], [2, 3], [3, 4]]);
12+
assert.true(map.deleteAll(1, 2));
13+
assert.deepEqual(from(map), [[3, 4]]);
1414

15-
set = new Map([[1, 2], [2, 3], [3, 4]]);
16-
assert.false(set.deleteAll(3, 4));
17-
assert.deepEqual(from(set), [[1, 2], [2, 3]]);
15+
map = new Map([[1, 2], [2, 3], [3, 4]]);
16+
assert.false(map.deleteAll(3, 4));
17+
assert.deepEqual(from(map), [[1, 2], [2, 3]]);
1818

19-
set = new Map([[1, 2], [2, 3], [3, 4]]);
20-
assert.false(set.deleteAll(4, 5));
21-
assert.deepEqual(from(set), [[1, 2], [2, 3], [3, 4]]);
19+
map = new Map([[1, 2], [2, 3], [3, 4]]);
20+
assert.false(map.deleteAll(4, 5));
21+
assert.deepEqual(from(map), [[1, 2], [2, 3], [3, 4]]);
2222

23-
set = new Map([[1, 2], [2, 3], [3, 4]]);
24-
assert.true(set.deleteAll());
25-
assert.deepEqual(from(set), [[1, 2], [2, 3], [3, 4]]);
23+
map = new Map([[1, 2], [2, 3], [3, 4]]);
24+
assert.true(map.deleteAll());
25+
assert.deepEqual(from(map), [[1, 2], [2, 3], [3, 4]]);
2626

2727
assert.throws(() => deleteAll.call({ delete() { /* empty */ } }, 1, 2, 3));
2828
assert.throws(() => deleteAll.call({}, 1, 2, 3), TypeError);

tests/unit-global/esnext.map.every.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ QUnit.test('Map#every', assert => {
1111
map.every(function (value, key, that) {
1212
assert.same(arguments.length, 3, 'correct number of callback arguments');
1313
assert.same(value, 1, 'correct value in callback');
14-
assert.same(key, 9, 'correct index in callback');
14+
assert.same(key, 9, 'correct key in callback');
1515
assert.same(that, map, 'correct link to map in callback');
1616
assert.same(this, context, 'correct callback context');
1717
}, context);

tests/unit-global/esnext.map.find-key.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ QUnit.test('Map#findKey', assert => {
77
assert.looksNative(findKey);
88
assert.nonEnumerable(Map.prototype, 'findKey');
99

10-
const set = new Map([[1, 2]]);
10+
const map = new Map([[1, 2]]);
1111
const context = {};
12-
set.findKey(function (value, key, that) {
12+
map.findKey(function (value, key, that) {
1313
assert.same(arguments.length, 3, 'correct number of callback arguments');
1414
assert.same(value, 2, 'correct value in callback');
1515
assert.same(key, 1, 'correct key in callback');
16-
assert.same(that, set, 'correct link to set in callback');
16+
assert.same(that, map, 'correct link to map in callback');
1717
assert.same(this, context, 'correct callback context');
1818
}, context);
1919

tests/unit-global/esnext.map.find.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ QUnit.test('Map#find', assert => {
77
assert.looksNative(find);
88
assert.nonEnumerable(Map.prototype, 'find');
99

10-
const set = new Map([[1, 2]]);
10+
const map = new Map([[1, 2]]);
1111
const context = {};
12-
set.find(function (value, key, that) {
12+
map.find(function (value, key, that) {
1313
assert.same(arguments.length, 3, 'correct number of callback arguments');
1414
assert.same(value, 2, 'correct value in callback');
1515
assert.same(key, 1, 'correct key in callback');
16-
assert.same(that, set, 'correct link to set in callback');
16+
assert.same(that, map, 'correct link to map in callback');
1717
assert.same(this, context, 'correct callback context');
1818
}, context);
1919

tests/unit-global/esnext.map.reduce.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ QUnit.test('Map#reduce', assert => {
77
assert.looksNative(reduce);
88
assert.nonEnumerable(Map.prototype, 'reduce');
99

10-
const set = new Map([['a', 1]]);
10+
const map = new Map([['a', 1]]);
1111
const accumulator = {};
12-
set.reduce(function (memo, value, key, that) {
12+
map.reduce(function (memo, value, key, that) {
1313
assert.same(arguments.length, 4, 'correct number of callback arguments');
1414
assert.same(memo, accumulator, 'correct callback accumulator');
1515
assert.same(value, 1, 'correct value in callback');
16-
assert.same(key, 'a', 'correct index in callback');
17-
assert.same(that, set, 'correct link to set in callback');
16+
assert.same(key, 'a', 'correct key in callback');
17+
assert.same(that, map, 'correct link to map in callback');
1818
}, accumulator);
1919

2020
assert.same(new Map([
@@ -29,7 +29,7 @@ QUnit.test('Map#reduce', assert => {
2929
]).reduce((memo, value, key) => {
3030
assert.same(memo, 1, 'correct default accumulator');
3131
assert.same(value, 2, 'correct start value without initial accumulator');
32-
assert.same(key, 'b', 'correct start index without initial accumulator');
32+
assert.same(key, 'b', 'correct start key without initial accumulator');
3333
});
3434

3535
assert.same(new Map([

tests/unit-global/esnext.map.some.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ QUnit.test('Map#some', assert => {
1111
map.some(function (value, key, that) {
1212
assert.same(arguments.length, 3, 'correct number of callback arguments');
1313
assert.same(value, 1, 'correct value in callback');
14-
assert.same(key, 9, 'correct index in callback');
14+
assert.same(key, 9, 'correct key in callback');
1515
assert.same(that, map, 'correct link to map in callback');
1616
assert.same(this, context, 'correct callback context');
1717
}, context);

tests/unit-global/web.dom-exception.constructor.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ QUnit.test('DOMException', assert => {
5454

5555
for (const name in errors) {
5656
error = new DOMException(42, name);
57-
assert.true(error instanceof DOMException, `new DOMException({}, "${ name }") instanceof DOMException`);
58-
assert.same(error.message, '42', `new DOMException({}, "${ name }").message`);
59-
assert.same(error.name, name, `new DOMException({}, "${ name }").name`);
60-
if (errors[name].m) assert.same(error.code, errors[name].c, `new DOMException({}, "${ name }").code`);
57+
assert.true(error instanceof DOMException, `new DOMException(42, "${ name }") instanceof DOMException`);
58+
assert.same(error.message, '42', `new DOMException(42, "${ name }").message`);
59+
assert.same(error.name, name, `new DOMException(42, "${ name }").name`);
60+
if (errors[name].m) assert.same(error.code, errors[name].c, `new DOMException(42, "${ name }").code`);
6161
// NodeJS and Deno set codes to deprecated errors
62-
else if (!NODE) assert.same(error.code, 0, `new DOMException({}, "${ name }").code`);
63-
assert.same(String(error), `${ name }: 42`, `String(new DOMException({}, "${ name }"))`); // Safari 10.1 bug
64-
if (HAS_STACK) assert.true('stack' in error, `'stack' in new DOMException({}, "${ name }")`);
62+
else if (!NODE) assert.same(error.code, 0, `new DOMException(42, "${ name }").code`);
63+
assert.same(String(error), `${ name }: 42`, `String(new DOMException(42, "${ name }"))`); // Safari 10.1 bug
64+
if (HAS_STACK) assert.true('stack' in error, `'stack' in new DOMException(42, "${ name }")`);
6565

6666
assert.same(DOMException[errors[name].s], errors[name].c, `DOMException.${ errors[name].s }`);
6767
assert.same(DOMException.prototype[errors[name].s], errors[name].c, `DOMException.prototype.${ errors[name].s }`);

tests/unit-pure/esnext.map.delete-all.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ QUnit.test('Map#deleteAll', assert => {
88
assert.arity(deleteAll, 0);
99
assert.nonEnumerable(Map.prototype, 'deleteAll');
1010

11-
let set = new Map([[1, 2], [2, 3], [3, 4]]);
12-
assert.true(set.deleteAll(1, 2));
13-
assert.deepEqual(from(set), [[3, 4]]);
11+
let map = new Map([[1, 2], [2, 3], [3, 4]]);
12+
assert.true(map.deleteAll(1, 2));
13+
assert.deepEqual(from(map), [[3, 4]]);
1414

15-
set = new Map([[1, 2], [2, 3], [3, 4]]);
16-
assert.false(set.deleteAll(3, 4));
17-
assert.deepEqual(from(set), [[1, 2], [2, 3]]);
15+
map = new Map([[1, 2], [2, 3], [3, 4]]);
16+
assert.false(map.deleteAll(3, 4));
17+
assert.deepEqual(from(map), [[1, 2], [2, 3]]);
1818

19-
set = new Map([[1, 2], [2, 3], [3, 4]]);
20-
assert.false(set.deleteAll(4, 5));
21-
assert.deepEqual(from(set), [[1, 2], [2, 3], [3, 4]]);
19+
map = new Map([[1, 2], [2, 3], [3, 4]]);
20+
assert.false(map.deleteAll(4, 5));
21+
assert.deepEqual(from(map), [[1, 2], [2, 3], [3, 4]]);
2222

23-
set = new Map([[1, 2], [2, 3], [3, 4]]);
24-
assert.true(set.deleteAll());
25-
assert.deepEqual(from(set), [[1, 2], [2, 3], [3, 4]]);
23+
map = new Map([[1, 2], [2, 3], [3, 4]]);
24+
assert.true(map.deleteAll());
25+
assert.deepEqual(from(map), [[1, 2], [2, 3], [3, 4]]);
2626

2727
assert.throws(() => deleteAll.call({ delete() { /* empty */ } }, 1, 2, 3));
2828
assert.throws(() => deleteAll.call({}, 1, 2, 3), TypeError);

tests/unit-pure/esnext.map.every.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ QUnit.test('Map#every', assert => {
1212
map.every(function (value, key, that) {
1313
assert.same(arguments.length, 3, 'correct number of callback arguments');
1414
assert.same(value, 1, 'correct value in callback');
15-
assert.same(key, 9, 'correct index in callback');
15+
assert.same(key, 9, 'correct key in callback');
1616
assert.same(that, map, 'correct link to map in callback');
1717
assert.same(this, context, 'correct callback context');
1818
}, context);

0 commit comments

Comments
 (0)