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