#!/usr/bin/env python3 from rfc1982_serial_number import Serial, step, show from random import randint for test in range(10000): i1 = Serial(randint(0, Serial.modulus - 1)) i2 = Serial(randint(0, Serial.modulus - 1)) assert i1 == i2 or \ (i1 < i2 and not (i1 > i2)) or \ (i1 > i2 and not (i1 < i2)) or \ int(i1) & int(i2) == Serial.modulus >> 1 show(step(i1, i2))