Skip to content

Commit 83a9f55

Browse files
author
Valerie R Young
committed
Revert changes to toNumber, fix comparison of infinity in cast.compare
1 parent dd81a26 commit 83a9f55

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/unit/blocks_operators_infinity.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test('divide: division with Infinity', t => {
1616
blocks.divide({NUM1: 'Infinity', NUM2: 111}), Infinity, '"Infinity" / 111 = Infinity'
1717
);
1818
t.strictEqual(
19-
blocks.divide({NUM1: 'INFINITY', NUM2: 222}), Infinity, '"INFINITY" / 222 = Infinity'
19+
blocks.divide({NUM1: 'INFINITY', NUM2: 222}), 0, '"INFINITY" / 222 = 0'
2020
);
2121
t.strictEqual(
2222
blocks.divide({NUM1: Infinity, NUM2: 333}), Infinity, 'Infinity / 333 = Infinity'
@@ -26,7 +26,7 @@ test('divide: division with Infinity', t => {
2626
blocks.divide({NUM1: 111, NUM2: 'Infinity'}), 0, '111 / "Infinity" = 0'
2727
);
2828
t.strictEqual(
29-
blocks.divide({NUM1: 222, NUM2: 'INFINITY'}), 0, '222 / "INFINITY" = 0'
29+
blocks.divide({NUM1: 222, NUM2: 'INFINITY'}), Infinity, '222 / "INFINITY" = Infinity'
3030
);
3131
t.strictEqual(
3232
blocks.divide({NUM1: 333, NUM2: Infinity}), 0, '333 / Infinity = 0'
@@ -36,7 +36,7 @@ test('divide: division with Infinity', t => {
3636
blocks.divide({NUM1: '-Infinity', NUM2: 111}), -Infinity, '"-Infinity" / 111 = -Infinity'
3737
);
3838
t.strictEqual(
39-
blocks.divide({NUM1: '-INFINITY', NUM2: 222}), -Infinity, '"-INFINITY" / 222 = -Infinity'
39+
blocks.divide({NUM1: '-INFINITY', NUM2: 222}), 0, '"-INFINITY" / 222 = 0'
4040
);
4141
t.strictEqual(
4242
blocks.divide({NUM1: -Infinity, NUM2: 333}), -Infinity, '-Infinity / 333 = -Infinity'
@@ -46,7 +46,7 @@ test('divide: division with Infinity', t => {
4646
blocks.divide({NUM1: 111, NUM2: '-Infinity'}), 0, '111 / "-Infinity" = 0'
4747
);
4848
t.strictEqual(
49-
blocks.divide({NUM1: 222, NUM2: '-INFINITY'}), 0, '222 / "-INFINITY" = 0'
49+
blocks.divide({NUM1: 222, NUM2: '-INFINITY'}), Infinity, '222 / "-INFINITY" = Infinity'
5050
);
5151
t.strictEqual(
5252
blocks.divide({NUM1: 333, NUM2: -Infinity}), 0, '333 / -Infinity = 0'
@@ -60,7 +60,7 @@ test('multiply: multiply Infinity with numbers', t => {
6060
blocks.multiply({NUM1: 'Infinity', NUM2: 111}), Infinity, '"Infinity" * 111 = Infinity'
6161
);
6262
t.strictEqual(
63-
blocks.multiply({NUM1: 'INFINITY', NUM2: 222}), Infinity, '"INFINITY" * 222 = Infinity'
63+
blocks.multiply({NUM1: 'INFINITY', NUM2: 222}), 0, '"INFINITY" * 222 = 0'
6464
);
6565
t.strictEqual(
6666
blocks.multiply({NUM1: Infinity, NUM2: 333}), Infinity, 'Infinity * 333 = Infinity'
@@ -69,7 +69,7 @@ test('multiply: multiply Infinity with numbers', t => {
6969
blocks.multiply({NUM1: '-Infinity', NUM2: 111}), -Infinity, '"-Infinity" * 111 = -Infinity'
7070
);
7171
t.strictEqual(
72-
blocks.multiply({NUM1: '-INFINITY', NUM2: 222}), -Infinity, '"-INFINITY" * 222 = -Infinity'
72+
blocks.multiply({NUM1: '-INFINITY', NUM2: 222}), 0, '"-INFINITY" * 222 = 0'
7373
);
7474
t.strictEqual(
7575
blocks.multiply({NUM1: -Infinity, NUM2: 333}), -Infinity, '-Infinity * 333 = -Infinity'
@@ -90,7 +90,7 @@ test('add: add Infinity to a number', t => {
9090
blocks.add({NUM1: 'Infinity', NUM2: 111}), Infinity, '"Infinity" + 111 = Infinity'
9191
);
9292
t.strictEqual(
93-
blocks.add({NUM1: 'INFINITY', NUM2: 222}), Infinity, '"INFINITY" + 222 = Infinity'
93+
blocks.add({NUM1: 'INFINITY', NUM2: 222}), 222, '"INFINITY" + 222 = 222'
9494
);
9595
t.strictEqual(
9696
blocks.add({NUM1: Infinity, NUM2: 333}), Infinity, 'Infinity + 333 = Infinity'
@@ -99,7 +99,7 @@ test('add: add Infinity to a number', t => {
9999
blocks.add({NUM1: '-Infinity', NUM2: 111}), -Infinity, '"-Infinity" + 111 = -Infinity'
100100
);
101101
t.strictEqual(
102-
blocks.add({NUM1: '-INFINITY', NUM2: 222}), -Infinity, '"-INFINITY" + 222 = -Infinity'
102+
blocks.add({NUM1: '-INFINITY', NUM2: 222}), 222, '"-INFINITY" + 222 = 222'
103103
);
104104
t.strictEqual(
105105
blocks.add({NUM1: -Infinity, NUM2: 333}), -Infinity, '-Infinity + 333 = -Infinity'
@@ -117,7 +117,7 @@ test('subtract: subtract Infinity with a number', t => {
117117
blocks.subtract({NUM1: 'Infinity', NUM2: 111}), Infinity, '"Infinity" - 111 = Infinity'
118118
);
119119
t.strictEqual(
120-
blocks.subtract({NUM1: 'INFINITY', NUM2: 222}), Infinity, '"INFINITY" - 222 = Infinity'
120+
blocks.subtract({NUM1: 'INFINITY', NUM2: 222}), -222, '"INFINITY" - 222 = -222'
121121
);
122122
t.strictEqual(
123123
blocks.subtract({NUM1: Infinity, NUM2: 333}), Infinity, 'Infinity - 333 = Infinity'
@@ -126,7 +126,7 @@ test('subtract: subtract Infinity with a number', t => {
126126
blocks.subtract({NUM1: 111, NUM2: 'Infinity'}), -Infinity, '111 - "Infinity" = -Infinity'
127127
);
128128
t.strictEqual(
129-
blocks.subtract({NUM1: 222, NUM2: 'INFINITY'}), -Infinity, '222 - "INFINITY" = -Infinity'
129+
blocks.subtract({NUM1: 222, NUM2: 'INFINITY'}), 222, '222 - "INFINITY" = 222'
130130
);
131131
t.strictEqual(
132132
blocks.subtract({NUM1: 333, NUM2: Infinity}), -Infinity, '333 - Infinity = -Infinity'

0 commit comments

Comments
 (0)