Mercurial > lcfOS
comparison test/testsamples.py @ 372:68841f9ab96c
Added yet another test snippet
author | Windel Bouwman |
---|---|
date | Fri, 21 Mar 2014 12:33:30 +0100 |
parents | 39bf68bf1891 |
children | 72a3b646d543 |
comparison
equal
deleted
inserted
replaced
371:9c95f93f5b7a | 372:68841f9ab96c |
---|---|
38 io.print2("A = ", i); | 38 io.print2("A = ", i); |
39 } | 39 } |
40 } | 40 } |
41 """ | 41 """ |
42 res = "".join("A = 0x{0:08X}\n".format(a) for a in range(10)) | 42 res = "".join("A = 0x{0:08X}\n".format(a) for a in range(10)) |
43 self.do(snippet, res) | |
44 | |
45 def testParameterPassing4(self): | |
46 snippet = """ | |
47 module sample; | |
48 import io; | |
49 function void dump(int a, int b, int c, int d) | |
50 { | |
51 io.print2("a=", a); | |
52 io.print2("b=", b); | |
53 io.print2("c=", c); | |
54 io.print2("d=", d); | |
55 } | |
56 function void start() | |
57 { | |
58 dump(4,55,66,0x1337); | |
59 } | |
60 """ | |
61 res = "a=0x{0:08X}\n".format(4) | |
62 res += "b=0x{0:08X}\n".format(55) | |
63 res += "c=0x{0:08X}\n".format(66) | |
64 res += "d=0x{0:08X}\n".format(0x1337) | |
43 self.do(snippet, res) | 65 self.do(snippet, res) |
44 | 66 |
45 def testGlobalVariable(self): | 67 def testGlobalVariable(self): |
46 snippet = """ | 68 snippet = """ |
47 module sample; | 69 module sample; |