示例#1
0
 def testIntegers(self):
     value = br.emvm_run(br.IntegerLiteral(12) + br.IntegerLiteral(13))
     self.assertEquals(25, value, "addition failed")
     self.assertFalse(
         br.emvm_run(br.IntegerLiteral(1) == br.IntegerLiteral(2)),
         "Equality comparison failed")
     self.assertTrue(
         br.emvm_run(br.IntegerLiteral(-10) == br.IntegerLiteral(-10)),
         "Equality comparison failed")
示例#2
0
 def testIntegers(self):
     value = br.emvm_run(br.IntegerLiteral(12) + br.IntegerLiteral(13))
     self.assertEquals(25, value, "addition failed")
     self.assertFalse(
         br.emvm_run(br.IntegerLiteral(1) == br.IntegerLiteral(2)),
         "Equality comparison failed")
     self.assertTrue(
         br.emvm_run(br.IntegerLiteral(-10) == br.IntegerLiteral(-10)),
         "Equality comparison failed")
示例#3
0
 def testFactorial(self):
     self.assertEquals(
         24, br.emvm_run(br.Call(factorial, [br.IntegerLiteral(4)])),
         "Incorrect factorial call")
示例#4
0
 def testCall(self):
     self.assertEquals(
         5,
         br.emvm_run(
             br.Call(sum, [br.IntegerLiteral(2),
                           br.IntegerLiteral(3)])), "Function call failed")
示例#5
0
 def testFactorial(self):
     self.assertEquals(
         24,
         br.emvm_run(
             br.Call(factorial, [br.IntegerLiteral(4)])),
         "Incorrect factorial call")
示例#6
0
 def testCall(self):
     self.assertEquals(
         5,
         br.emvm_run(
             br.Call(sum, [br.IntegerLiteral(2), br.IntegerLiteral(3)])),
         "Function call failed")