Exemplo n.º 1
0
 def test_if_print_has_no_turtle(self):
     code = textwrap.dedent("""\
 jouwkeuze is schaar
 computerkeuze is schaar
 if computerkeuze is jouwkeuze print 'gelijkspel!'""")
     result = hedy.transpile_inner(code, self.level)
     self.assertEqual(False, result.has_turtle)
Exemplo n.º 2
0
 def test_print_has_no_turtle(self):
   result = hedy.transpile_inner("print koekoek", self.level)
   expected = False
   self.assertEqual(expected, result.has_turtle)
Exemplo n.º 3
0
 def test_one_forward_has_turtle(self):
   result = hedy.transpile_inner("forward 50", self.level)
   expected = True
   self.assertEqual(expected, result.has_turtle)
Exemplo n.º 4
0
 def test_turtle_with_ask_has_turtle(self):
     code = textwrap.dedent("""\
 afstand is ask 'hoe ver dan?'
 forward afstand""")
     result = hedy.transpile_inner(code, self.level)
     self.assertEqual(True, result.has_turtle)