changeset 374:72a3b646d543

Added if statement sample
author Windel Bouwman
date Fri, 21 Mar 2014 15:27:18 +0100
parents fc1b89b09896
children 19eacf4f7270
files test/testsamples.py
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/testsamples.py	Fri Mar 21 14:32:54 2014 +0100
+++ b/test/testsamples.py	Fri Mar 21 15:27:18 2014 +0100
@@ -42,6 +42,27 @@
         res = "".join("A = 0x{0:08X}\n".format(a) for a in range(10))
         self.do(snippet, res)
 
+    def testIfStatement(self):
+        snippet = """
+         module sample;
+         import io;
+         function void start()
+         {
+            var int i;
+            i = 13;
+            if (i*7 < 100)
+            {
+                io.print("Wow");
+            }
+            else
+            {
+                io.print("Outch");
+            }
+         }
+        """
+        res = "Wow"
+        self.do(snippet, res)
+
     def testParameterPassing4(self):
         snippet = """
          module sample;