Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 3
0
 def testFactorial(self):
     self.assertEquals(
         24, br.emvm_run(br.Call(factorial, [br.IntegerLiteral(4)])),
         "Incorrect factorial call")
Ejemplo n.º 4
0
 def testCall(self):
     self.assertEquals(
         5,
         br.emvm_run(
             br.Call(sum, [br.IntegerLiteral(2),
                           br.IntegerLiteral(3)])), "Function call failed")
Ejemplo n.º 5
0
 def testFactorial(self):
     self.assertEquals(
         24,
         br.emvm_run(
             br.Call(factorial, [br.IntegerLiteral(4)])),
         "Incorrect factorial call")
Ejemplo n.º 6
0
 def testCall(self):
     self.assertEquals(
         5,
         br.emvm_run(
             br.Call(sum, [br.IntegerLiteral(2), br.IntegerLiteral(3)])),
         "Function call failed")