Пример #1
0
 def test_interpreter_should_return_Hello_World(self):
     interpreter = Interpreter("echo^<<Hello World!>>")
     self.assertEqual(interpreter.response(), "Forest says: Hello World!")
Пример #2
0
 def test_simple_fizz_feature(self):
    interpreter = Interpreter("WALK_PATH_IF_SEE^6^(*)>^3^OvO^0^echo^<<fizz>>")
    self.assertEqual(interpreter.response(), "Forest says: fizz")
Пример #3
0
 def test_interpreter_should_return_A_when_user_enters_A(self):
     interpreter = Interpreter("echo^<<A>>")
     self.assertEqual(interpreter.response(), "Forest says: A")
Пример #4
0
 def test_interpreter_should_return_integer_when_user_enters_4(self):
     interpreter = Interpreter("echo^<<4>>")
     self.assertEqual(interpreter.response(), "Forest says: 4")
Пример #5
0
 def test_boolean_non_equality(self):
     interpreter = Interpreter("true^XvX^false")
     self.assertEqual(interpreter.response(), True)
Пример #6
0
 def test_boolean_non_equality_when_wrong(self):
     interpreter = Interpreter("true^XvX^true")
     self.assertEqual(interpreter.response(), False)
Пример #7
0
 def test_boolean_equality(self):
     interpreter = Interpreter("true^OvO^true")
     self.assertEqual(interpreter.response(), True)
Пример #8
0
 def test_integer_non_equality_when_wrong(self):
     interpreter = Interpreter("7^XvX^7")
     self.assertEqual(interpreter.response(), False)
Пример #9
0
 def test_integer_non_equality(self):
     interpreter = Interpreter("7^XvX^3")
     self.assertEqual(interpreter.response(), True)
Пример #10
0
 def test_integer_equality(self):
     interpreter = Interpreter("7^OvO^7")
     self.assertEqual(interpreter.response(), True)
Пример #11
0
 def test_integer_modulus(self):
     interpreter = Interpreter("10^(*)>^5")
     self.assertEqual(interpreter.response(), 0)