@@ -38,13 +38,8 @@ Integer2Test = TestCase (
3838 "Sometimes it can be hard to implement efficiently, but it SHOULD really
3939 be true for all values of integers."
4040 a := 1 << 30. b := 1 << 30.
41- self optional: #integerIdentity assert: a is: b.
42-
4341 a := 1 << 32. b := 1 << 32.
44- self optional: #integerIdentity assert: a is: b.
45-
4642 a := 1 << 60. b := 1 << 60.
47- self optional: #integerIdentity assert: a is: b.
4843 )
4944
5045 testClassAndValueRanges = (
@@ -74,7 +69,6 @@ Integer2Test = TestCase (
7469 i := 1 << 70.
7570 self assert: Integer equals: i class.
7671 self assert: i > 0 description: 'should not overflow'.
77- self optional: #bigIntShifts assert: '1180591620717411303424' equals: i asString.
7872
7973 i := -1 << 30.
8074 self assert: Integer equals: i class.
@@ -94,7 +88,6 @@ Integer2Test = TestCase (
9488 i := -1 << 70.
9589 self assert: Integer equals: i class.
9690 self assert: i < 0 description: 'should not underflow'.
97- self optional: #bigIntShifts assert: '-1180591620717411303424' equals: i asString.
9891 )
9992
10093 testStringConversion = (
@@ -107,18 +100,16 @@ Integer2Test = TestCase (
107100 self assert: 42 equals: '42' asInteger.
108101 self assert: -2 equals: '-2' asInteger.
109102 )
110-
103+
111104 testIntegerLiterals = (
112105 "Make sure the parser reads literals correctly. So, check some basic properties"
113106 self assert: 2 / 2 equals: 1.
114107 self assert: 50 + 50 equals: 100.
115108 self assert: 92233720368 * 100000000 + 54775807 equals: 9223372036854775807.
116- self assert: 92233720368 * 100000000 + 54775807 * 100 equals: 922337203685477580700.
117109 self assert: 50 - 100 equals: -50.
118110 self assert: 21474 * -100000 - 83648 equals: -2147483648.
119- self assert: 92233720368 * 100000000 + 54775807 * -100 equals: -922337203685477580700.
120111 )
121-
112+
122113 testFromString = (
123114 self assert: 1 equals: (Integer fromString: '1').
124115 self assert: 100 equals: (Integer fromString: '100').
@@ -282,22 +273,14 @@ Integer2Test = TestCase (
282273 self assert: 0 equals: 1 >>> 1.
283274 self assert: 512 equals: 1024 >>> 1.
284275 self assert: 127 equals: 1023 >>> 3.
285-
286- "not sure whether we should really insist on this"
287- self optional: #toBeSpecified assert: 9223372036854775807 equals: -1 >>> 1.
288- self optional: #toBeSpecified assert: 9223372036854775296 equals: -1024 >>> 1.
289276 )
290277
291278 testMin = (
292279 "We need to test numbers that are 64bit or less, larger than 64bit,
293280 positive, and negative"
294281 | big small |
295- big := #(1 100 9223372036854775807 922337203685477580700
296- -50 -2147483648 922337203685477580700 -922337203685477580700
297- 922337203685477580700).
298- small := #(0 52 9223372036854775296 922337203685477529600
299- -51 -2147483650 1 -922337203685477580701
300- -922337203685477580701).
282+ big := #(1 100 -50 -2147483648).
283+ small := #(0 52 -51 -2147483650).
301284
302285 big doIndexes: [:i |
303286 self assert: (small at: i) equals: ((big at: i) min: (small at: i)).
@@ -308,12 +291,8 @@ Integer2Test = TestCase (
308291 "We need to test numbers that are 64bit or less, larger than 64bit,
309292 positive, and negative"
310293 | big small |
311- big := #(1 100 9223372036854775807 922337203685477580700
312- -50 -2147483648 922337203685477580700 -922337203685477580700
313- 922337203685477580700).
314- small := #(0 52 9223372036854775296 922337203685477529600
315- -51 -2147483650 1 -922337203685477580701
316- -922337203685477580701).
294+ big := #(1 100 -50 -2147483648).
295+ small := #(0 52 -51 -2147483650).
317296 big doIndexes: [:i |
318297 self assert: (big at: i) equals: ((big at: i) max: (small at: i)).
319298 self assert: (big at: i) equals: ((small at: i) max: (big at: i)) ]
0 commit comments