Piotr Caban : vbscript: Add for each tests on array.

Alexandre Julliard julliard at winehq.org
Wed Nov 8 16:01:10 CST 2017


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Nov  8 15:05:06 2017 +0100

vbscript: Add for each tests on array.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/vbscript/tests/lang.vbs | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index a904f5d..2af77bd 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -1304,6 +1304,35 @@ arr(0) = "not modified"
 modifyarr(arr)
 Call todo_wine_ok(arr(0) = "not modified", "arr(0) = " & arr(0))
 
+for x = 0 to UBound(arr)
+    arr(x) = x
+next
+y = 0
+for each x in arr
+    Call ok(x = y, "x = " & x & ", expected " & y)
+    Call ok(arr(y) = y, "arr(" & y & ") = " & arr(y))
+    arr(y) = 1
+    x = 1
+    y = y+1
+next
+Call ok(y = 4, "y = " & y & " after array enumeration")
+
+for x=0 to UBound(arr2, 1)
+    for y=0 to UBound(arr2, 2)
+        arr2(x, y) = x + y*(UBound(arr2, 1)+1)
+    next
+next
+y = 0
+for each x in arr2
+    Call ok(x = y, "x = " & x & ", expected " & y)
+    y = y+1
+next
+Call ok(y = 20, "y = " & y & " after array enumeration")
+
+for each x in noarr
+    Call ok(false, "Empty array contains: " & x)
+next
+
 ' It's allowed to declare non-builtin RegExp class...
 class RegExp
      public property get Global()




More information about the wine-cvs mailing list