Exemplo n.º 1
0
 def testinsertNegative(self):
     a = PCSet(self.l, multiset=True)
     b = PSet(self.l, multiset=True)
     a.insert(-2, 2)
     b.insert(-3, 12)
     self.assertEqual(a.pitches, [1, 4, 23, 2, 5, -9])
     self.assertEqual(b.pitches, [1, 4, 12, 23, 5, -9])
Exemplo n.º 2
0
 def testinsertAfter(self):
     a = PCSet(self.l)
     b = PSet(self.l)
     a.insert(100, 1)
     b.insert(100, 0)
     self.assertEqual(a.pitches, self.l + [1])
     self.assertEqual(b.pitches, self.l + [0])
Exemplo n.º 3
0
 def testinsertMiddle(self):
     a = PCSet(self.l)
     b = PSet(self.l)
     a.insert(3, 15)
     b.insert(4, 8)
     self.assertEqual(a.pitches, [1, 4, 23, 15, 5, -9])
     self.assertEqual(b.pitches, [1, 4, 23, 5, 8, -9])
Exemplo n.º 4
0
 def testinsertEnd(self):
     a = PCSet(self.l)
     b = PSet(self.l)
     a.insert(6, 10)
     b.insert(6, 99)
     self.assertEqual(a.pitches, self.l + [10])
     self.assertEqual(b.pitches, self.l + [99])
Exemplo n.º 5
0
 def testinsertBegin(self):
     a = PCSet(self.l)
     b = PSet(self.l)
     a.insert(0, 10)
     b.insert(0, 11)
     self.assertEqual(a.pitches, [10] + self.l)
     self.assertEqual(b.pitches, [11] + self.l)