def test_interleave3(self): self.assertEqual( hex(interleave.interleave3(0x00, 0xFF, 0x00)), '0x492492' ) self.assertEqual( hex(interleave.interleave3(0x0000, 0xFFFF, 0x0000)), '0x12492492' )
def test_interleave3_with_loop_comparison(self): """ test that loop version of interleave3 produces the same results as the original """ integers = (4, 42, 7) interleaved = interleave.interleave3(*integers) interleaved_with_loop = alternative_interleave.interleave3_with_loop( *integers ) self.assertEqual(interleaved, interleaved_with_loop)
def test_idempotency3(self): for nums in self.num_sets: integers = list(nums[:3]) interleaved = interleave.interleave3(*integers) self.assertEqual(integers, interleave.deinterleave3(interleaved))
def test_interleave3(self): for nums in self.num_sets: self.assertEqual(interleave.interleave3(*nums[:3]), interleave.interleavem_naive(*nums[:3]))
def test_interleave3(self): self.assertEqual(hex(interleave.interleave3(0x00, 0xFF, 0x00)), '0x492492') self.assertEqual(hex(interleave.interleave3(0x0000, 0xFFFF, 0x0000)), '0x12492492')
def test_idempotency_3(self): integers = (4, 42, 36) interleaved = interleave.interleave3(*integers) self.assertEqual(integers, interleave.deinterleave3(interleaved))
def test_interleave3(self): self.assertEqual(hex(interleave.interleave3(0x00, 0xFF, 0x00)), hex(4793490)) self.assertEqual(hex(interleave.interleave3(0x0000, 0xFFFF, 0x0000)), hex(306783378))