Jacek Caban : vbscript: Added select case statement tests.

Alexandre Julliard julliard at winehq.org
Fri Jul 20 15:29:59 CDT 2012


Module: wine
Branch: master
Commit: 74f67ba82e1237dc8b9b4882304ee449508280ba
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=74f67ba82e1237dc8b9b4882304ee449508280ba

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jul 20 16:29:34 2012 +0200

vbscript: Added select case statement tests.

---

 dlls/vbscript/tests/lang.vbs |   56 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 9389462..2ba3e5a 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -440,6 +440,62 @@ next
 Call ok(y = 1, "y = " & y)
 Call ok(x = 2, "x = " & x)
 
+x = false
+select case 3
+    case 2
+        Call ok(false, "unexpected case")
+    case 2
+        Call ok(false, "unexpected case")
+    case 4
+        Call ok(false, "unexpected case")
+    case "test"
+    case "another case"
+        Call ok(false, "unexpected case")
+    case 0, false, 2+1, 10
+        x = true
+    case ok(false, "unexpected case")
+        Call ok(false, "unexpected case")
+    case else
+        Call ok(false, "unexpected case")
+end select
+Call ok(x, "wrong case")
+
+x = false
+select case 3
+    case 3
+        x = true
+end select
+Call ok(x, "wrong case")
+
+x = false
+select case 2+2
+    case 3
+        Call ok(false, "unexpected case")
+    case else
+        x = true
+end select
+Call ok(x, "wrong case")
+
+y = "3"
+x = false
+select case y
+    case "3"
+        x = true
+    case 3
+        Call ok(false, "unexpected case")
+end select
+Call ok(x, "wrong case")
+
+select case 0
+    case 1
+        Call ok(false, "unexpected case")
+    case "2"
+        Call ok(false, "unexpected case")
+end select
+
+select case 0
+end select
+
 if false then
 Sub testsub
     x = true




More information about the wine-cvs mailing list