comparison python/testc3.py @ 251:6ed3d3a82a63

Added another c3 example. First import attempt
author Windel Bouwman
date Mon, 29 Jul 2013 20:23:13 +0200
parents e41e4109addd
children c4370696ccc7
comparison
equal deleted inserted replaced
250:f5fba5b554d7 251:6ed3d3a82a63
119 self.assertTrue(ircode) 119 self.assertTrue(ircode)
120 actual_ins = [str(i) for i in ircode.Instructions] 120 actual_ins = [str(i) for i in ircode.Instructions]
121 expected_ins = [i.strip() for i in ir_out.split('\n')] 121 expected_ins = [i.strip() for i in ir_out.split('\n')]
122 self.assertSequenceEqual(expected_ins, actual_ins) 122 self.assertSequenceEqual(expected_ins, actual_ins)
123 return ircode 123 return ircode
124
125 def testPackage(self):
126 p1 = """package p1;
127 type int A;
128 """
129 p2 = """package p2;
130 import p1;
131 var A b;
132 """
133 self.assertTrue(self.builder.build(p1))
134 self.expectOK(p2)
124 135
125 def testFunctArgs(self): 136 def testFunctArgs(self):
126 snippet = """ 137 snippet = """
127 package testargs; 138 package testargs;
128 function void t2(int a, double b) 139 function void t2(int a, double b)