changeset 45:d16b44bf5ca2

Added test for global variables.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Tue, 26 May 2009 16:10:07 +0200
parents b852eb00a629
children 53d7060adc77
files pysmcl/test/unit/test_rangeanalysis.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/test/unit/test_rangeanalysis.py	Tue May 26 16:08:23 2009 +0200
+++ b/pysmcl/test/unit/test_rangeanalysis.py	Tue May 26 16:10:07 2009 +0200
@@ -128,5 +128,14 @@
 #         r = range_analysis.result
 #         self.assertEquals(r, {'y': (0, 1)})
 
+#     def test_range_global_variable(self):
+#         p = 7
+#         prog = parse("x=42\ndef f():\n\tx")
+#         init_statements(prog)
+#         range_analysis = RangeAnalysis(p)
+#         range_analysis.apply(prog.body[0])
+#         r = prog.body[0].body[1].out_values["range"]
+#         self.assertEquals(r, {'x': (0, p)})
+
 if __name__ == '__main__':
     unittest.main()