dartist / dart-bignum

Other
14 stars 11 forks source link

test/test_big_integer_v8.dart test is flaky #42

Open natebosch opened 7 years ago

natebosch commented 7 years ago

The test stringConv will fail infrequently. I found that if I leave it running long enough I'll hit a failure. while dart test/test_big_integer_v8.dart; do; done

Since it uses math.Random() I'm guessing there is an implementation bug that is exposed with only certain numbers. Here are some I've hit:

Expected: '3176795220495055933489697'
  Actual: '3176795220495056201925153'

Expected: '1489395682405911'
  Actual: '1489395950841367'

Expected: '780479349944740000586191'
  Actual: '780479349944740269021647'

Expected: '36894956365158654'
  Actual: '36894956633594110'
natebosch commented 7 years ago

To repro consistently:

Replace the byte_array randomness with

byte_array = [215, 103, 196, 67, 34, 226, 31, 25, 117, 106, 220, 42, 37, 170, 39, 226, 80, 226, 65, 144, 32, 200, 61, 247, 174, 90, 80, 221, 196, 93, 232, 148, 186, 251, 26, 65, 180      , 247, 227, 11, 158, 145, 119, 72, 173, 205, 179, 199, 11, 231, 232, 170, 162, 37, 48, 69, 194, 213, 219, 51, 196, 205, 242, 201, 192, 9, 67, 128, 96, 69, 220, 88, 81, 169, 4, 42, 48, 40, 7, 16      7, 217, 10, 109, 117, 8, 247, 231, 10, 238, 216, 203, 120, 241, 111, 98, 32, 30, 23];