コード例 #1
0
 def test_EnvironmentWithDoubleBackSlash(self):
     instruction = FileController.read(TestInterpreter.path +
                                       "EnvironmentWithDoubleBackSlash" +
                                       TestInterpreter.ext)
     res = Interpreter.execute(instruction)
     self.assertEqual(res, "0 & 1 & 2 \\\\ \n")
コード例 #2
0
 def test_MultilineEnvironment(self):
     instruction = FileController.read(TestInterpreter.path +
                                       "MultilineEnvironment" +
                                       TestInterpreter.ext)
     res = Interpreter.execute(instruction)
     self.assertEqual(res, "17")
コード例 #3
0
 def test_ErrorReporting(self):
     instruction = FileController.read(TestInterpreter.path +
                                       "ErrorReporting" +
                                       TestInterpreter.ext)
     res = Interpreter.execute(instruction)
     self.assertEqual(res, "division by zero")
コード例 #4
0
 def test_LineReturnStringInput(self):
     instruction = FileController.read(TestInterpreter.path +
                                       "LineReturnString" +
                                       TestInterpreter.ext)
     res = Interpreter.execute(instruction)
     self.assertEqual(res, "a\n")
コード例 #5
0
 def test_EmptyStringInput(self):
     instruction = FileController.read(TestInterpreter.path + "EmptyFile" +
                                       TestInterpreter.ext)
     res = Interpreter.execute(instruction)
     self.assertEqual(res, "")
コード例 #6
0
 def test_SimpleOperationPrint(self):
     instruction = FileController.read(TestInterpreter.path +
                                       "SimpleOperationPrint" +
                                       TestInterpreter.ext)
     res = Interpreter.execute(instruction)
     self.assertEqual(res, "3")