added more test cases

This commit is contained in:
hyunghwan.chung 2018-12-23 16:44:47 +00:00
parent 9e91e32c75
commit 3e623c6677

View File

@ -181,7 +181,33 @@ extend MyObject
[ "%#b" strfmt((-2305843009213693952 * -2305843009213693952 * 2305843009213693952 * 2305843009213693952 * 2305843009213693952) - 1 + 2) = '2r100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001' ], [ "%#b" strfmt((-2305843009213693952 * -2305843009213693952 * 2305843009213693952 * 2305843009213693952 * 2305843009213693952) - 1 + 2) = '2r100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001' ],
## 40 - 44 ## 40 - 44
[ "%#x" strfmt((-2305843009213693952 * -2305843009213693952 * 2305843009213693952 * 2305843009213693952 * 2305843009213693952) - 1 + 2) = '16r20000000000000000000000000000000000000000000000000000000000000000000000000001' ] [ "%#x" strfmt((-2305843009213693952 * -2305843009213693952 * 2305843009213693952 * 2305843009213693952 * 2305843009213693952) - 1 + 2) = '16r20000000000000000000000000000000000000000000000000000000000000000000000000001' ],
[ (7 div: -3) = -2 ],
[ (7 rem: -3) = 1 ],
[ (7 mdiv: -3) = -3 ],
[ (7 mod: -3) = -2 ],
## 45-49
[ ([ (7 div: 0) = -2 ] on: Exception do: [:ex | ex messageText ]) = 'divide by zero' ],
[ ([ (7 rem: 0) = -2 ] on: Exception do: [:ex | ex messageText ]) = 'divide by zero' ],
[ ([ (7 mdiv: 0) = -2 ] on: Exception do: [:ex | ex messageText ]) = 'divide by zero' ],
[ ([ (7 mod: 0) = -2 ] on: Exception do: [:ex | ex messageText ]) = 'divide by zero' ],
[ (270000000000000000000000000000000000000000000000000000000000000000000 div: 50000000000000000000000000000000000000000000000000000000000000000000) = 5 ],
## 50-54
[ (270000000000000000000000000000000000000000000000000000000000000000000 rem: 50000000000000000000000000000000000000000000000000000000000000000000) = 20000000000000000000000000000000000000000000000000000000000000000000 ],
[ (270000000000000000000000000000000000000000000000000000000000000000000 mdiv: 50000000000000000000000000000000000000000000000000000000000000000000) = 5],
[ (270000000000000000000000000000000000000000000000000000000000000000000 mod: 50000000000000000000000000000000000000000000000000000000000000000000) = 20000000000000000000000000000000000000000000000000000000000000000000 ],
[ (0 rem: -50000000000000000000000000000000000000000000000000000000000000000000) = 0 ],
[ (0 rem: -50000000000000000000000000000000000000000000000000000000000000000000) = 0 ],
## 55-59
[ (0 rem: -50000000000000000000000000000000000000000000000000000000000000000000) = 0 ],
[ (0 rem: -50000000000000000000000000000000000000000000000000000000000000000000) = 0 ],
[ (16r2dd01fc06c265c8163ac729b49d890939826ce3dd div: 16r3b9aca00) = 4184734490355220618401938634485367707982 ],
[ (16r2dd01fc06c265c8163ac729b49d890939826ce3dd rem: 16r3b9aca00) = 394876893 ],
[ (16rFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF bitAnd: 16r1111111111111111111111111111111111111111) = 16r1111111111111111111111111111111111111111 ]
). ).
limit := tc size. limit := tc size.