Exemple #1
0
 def test_shift_loop(self):
     a = graph.Tick((0,4), (False, True))
     b = graph.Tick((0,10,5), (False, True, False))
     
     actual = a << b
     expected = graph.Tick((0,10,5, 4), (False, True, False, True))
     self.assertEquals(actual, expected)
Exemple #2
0
 def test_repr_shift_loop(self):
     t = graph.Tick((0,10,4), (False, True, False))
     self.assertEqual("(*10, 4)", repr(t))
Exemple #3
0
 def test_repr_noshift_loop(self):
     t = graph.Tick((0,4), (False, True))
     self.assertEqual("*4", repr(t))
Exemple #4
0
 def test_loop_elements(self):
     t = graph.Tick((0,10,5,3), (False, True, False, True))
     self.assertEquals((10, 3), t.loop_elements)
Exemple #5
0
 def test_mark_loop_iteration(self):
     t = graph.Tick((0,10,5), (False, False, False))
     actual = t.mark_loop_iteration()
     expected = graph.Tick((0,10,5), (False, False, True))
     self.assertEquals(actual, expected)
Exemple #6
0
 def test_shift(self):
     a = graph.Tick((0,1), (False, False))
     b = graph.Tick((0,2), (False, False))
     actual = a << b
     expected = graph.Tick((0,2,1), (False, False, False))
     self.assertEquals(actual, expected)
Exemple #7
0
 def test_inc_loop(self):
     t = graph.Tick((0,4), (False, True))
     t += 10
     expected = graph.Tick((0,14), (False, True))
     self.assertEqual(t, expected)
Exemple #8
0
 def test_parse_str_loop(self):
     expected = graph.Tick((0,1,2,3), (False, False, True, False))
     actual = graph.Tick.parse_tick("1,*2,3")
     self.assertEquals(actual, expected)