示例#1
0
 def test_copy(self):
     r = btree_mini.BTreeSet({i for i in range(10)})
     r_copy = r.copy()
     for a, b in zip(r, r_copy):
         self.assertEqual(a, b)
示例#2
0
 def test_reversed(self):
     r = btree_mini.BTreeSet({i for i in range(10)})
     for a, b in zip(reversed(r), reversed(range(10))):
         self.assertEqual(a, b)
示例#3
0
 def test_create_list(self):
     data = [(i, -i) for i in range(10)]
     r = btree_mini.BTreeSet(data)
     self.assertEqual(data, list(r))
示例#4
0
 def test_clear(self):
     r = btree_mini.BTreeSet({i for i in range(10)})
     r.clear()
     self.assertEqual(0, len(list(r)))
示例#5
0
 def test_create_set(self):
     data = {i for i in range(10)}
     r = btree_mini.BTreeSet(data)
     self.assertEqual(list(data), list(r))