2 ' Copyright 2011 Jacek Caban for CodeWeavers
4 ' This library is free software; you can redistribute it and/or
5 ' modify it under the terms of the GNU Lesser General Public
6 ' License as published by the Free Software Foundation; either
7 ' version 2.1 of the License, or (at your option) any later version.
9 ' This library is distributed in the hope that it will be useful,
10 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ' Lesser General Public License for more details.
14 ' You should have received a copy of the GNU Lesser General Public
15 ' License along with this library; if not, write to the Free Software
16 ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 OPTION EXPLICIT : : DIM W
24 call ok(true, "true is not true?")
25 ok
true, "true is not true?"
26 call ok((true), "true is not true?")
28 ok
not false, "not false but not true?"
29 ok
not not true, "not not true but not true?"
31 Call ok(true = true, "true = true is false")
32 Call ok(false = false, "false = false is false")
33 Call ok(not (true = false), "true = false is true")
34 Call ok("x" = "x", """x"" = ""x"" is false")
35 Call ok(empty
= empty
, "empty = empty is false")
36 Call ok(empty
= "", "empty = """" is false")
37 Call ok(0 = 0.0, "0 <> 0.0")
38 Call ok(16 = &h10
&, "16 <> &h10&")
39 Call ok(010 = 10, "010 <> 10")
40 Call ok(10. = 10, "10. <> 10")
41 Call ok(&hffFFffFF
& = -1, "&hffFFffFF& <> -1")
42 Call ok(&hffFFffFF
& = -1, "&hffFFffFF& <> -1")
43 Call ok(34e5
= 3400000, "34e5 <> 3400000")
44 Call ok(34e+5 = 3400000, "34e+5 <> 3400000")
45 Call ok(56.789e5
= 5678900, "56.789e5 = 5678900")
46 Call ok(56.789e-2 = 0.56789, "56.789e-2 <> 0.56789")
47 Call ok(1e-94938484 = 0, "1e-... <> 0")
48 Call ok(34e0
= 34, "34e0 <> 34")
49 Call ok(34E1
= 340, "34E0 <> 340")
50 Call ok(--1 = 1, "--1 = " & --1)
51 Call ok(-empty
= 0, "-empty = " & (-empty
))
52 Call ok(true = -1, "! true = -1")
53 Call ok(false = 0, "false <> 0")
54 Call ok(&hff
= 255, "&hff <> 255")
55 Call ok(&Hff
= 255, "&Hff <> 255")
56 Call ok(&hffff
= -1, "&hffff <> -1")
57 Call ok(&hfffe
= -2, "&hfffe <> -2")
58 Call ok(&hffff
& = 65535, "&hffff& <> -1")
59 Call ok(&hfffe
& = 65534, "&hfffe& <> -2")
60 Call ok(&hffffffff
& = -1, "&hffffffff& <> -1")
63 Call ok(W
= 5, "W = " & W
& " expected " & 5)
66 Call ok(x
= "xx", "x = " & x
& " expected ""xx""")
68 Call ok(true <> false, "true <> false is false")
69 Call ok(not (true <> true), "true <> true is true")
70 Call ok(not ("x" <> "x"), """x"" <> ""x"" is true")
71 Call ok(not (empty
<> empty
), "empty <> empty is true")
72 Call ok(x
<> "x", "x = ""x""")
73 Call ok("true" <> true, """true"" = true is true")
75 Call ok("" = true = false, """"" = true = false is false")
76 Call ok(not(false = true = ""), "false = true = """" is true")
77 Call ok(not (false = false <> false = false), "false = false <> false = false is true")
78 Call ok(not ("" <> false = false), """"" <> false = false is true")
80 Call ok(getVT(false) = "VT_BOOL", "getVT(false) is not VT_BOOL")
81 Call ok(getVT(true) = "VT_BOOL", "getVT(true) is not VT_BOOL")
82 Call ok(getVT("") = "VT_BSTR", "getVT("""") is not VT_BSTR")
83 Call ok(getVT("test") = "VT_BSTR", "getVT(""test"") is not VT_BSTR")
84 Call ok(getVT(Empty
) = "VT_EMPTY", "getVT(Empty) is not VT_EMPTY")
85 Call ok(getVT(null
) = "VT_NULL", "getVT(null) is not VT_NULL")
86 Call ok(getVT(0) = "VT_I2", "getVT(0) is not VT_I2")
87 Call ok(getVT(1) = "VT_I2", "getVT(1) is not VT_I2")
88 Call ok(getVT(0.5) = "VT_R8", "getVT(0.5) is not VT_R8")
89 Call ok(getVT(0.0) = "VT_R8", "getVT(0.0) is not VT_R8")
90 Call ok(getVT(2147483647) = "VT_I4", "getVT(2147483647) is not VT_I4")
91 Call ok(getVT(2147483648) = "VT_R8", "getVT(2147483648) is not VT_R8")
92 Call ok(getVT(&h10
&) = "VT_I2", "getVT(&h10&) is not VT_I2")
93 Call ok(getVT(&h10000
&) = "VT_I4", "getVT(&h10000&) is not VT_I4")
94 Call ok(getVT(&H10000
&) = "VT_I4", "getVT(&H10000&) is not VT_I4")
95 Call ok(getVT(&hffFFffFF
&) = "VT_I2", "getVT(&hffFFffFF&) is not VT_I2")
96 Call ok(getVT(&hffFFffFE
&) = "VT_I2", "getVT(&hffFFffFE &) is not VT_I2")
97 Call ok(getVT(&hffF
&) = "VT_I2", "getVT(&hffFF&) is not VT_I2")
98 Call ok(getVT(&hffFF
&) = "VT_I4", "getVT(&hffFF&) is not VT_I4")
99 Call ok(getVT(1e2
) = "VT_R8", "getVT(1e2) is not VT_R8")
100 Call ok(getVT(1e0
) = "VT_R8", "getVT(1e0) is not VT_R8")
101 Call ok(getVT(0.1e2
) = "VT_R8", "getVT(0.1e2) is not VT_R8")
102 Call ok(getVT(1 & 100000) = "VT_BSTR", "getVT(1 & 100000) is not VT_BSTR")
103 Call ok(getVT(-empty
) = "VT_I2", "getVT(-empty) = " & getVT(-empty
))
104 Call ok(getVT(-null
) = "VT_NULL", "getVT(-null) = " & getVT(-null
))
105 Call ok(getVT(y
) = "VT_EMPTY*", "getVT(y) = " & getVT(y
))
106 Call ok(getVT(nothing) = "VT_DISPATCH", "getVT(nothing) = " & getVT(nothing))
108 Call ok(getVT(x
) = "VT_DISPATCH*", "getVT(x=nothing) = " & getVT(x
))
110 Call ok(getVT(x
) = "VT_BOOL*", "getVT(x) = " & getVT(x
))
111 Call ok(getVT(false or true) = "VT_BOOL", "getVT(false) is not VT_BOOL")
113 Call ok(getVT(x
) = "VT_BSTR*", "getVT(x) is not VT_BSTR*")
115 Call ok(getVT(x
) = "VT_R8*", "getVT(x) = " & getVT(x
))
117 Call ok(isNullDisp(nothing), "nothing is not nulldisp?")
120 Call ok("ab" & "cd" = "abcd", """ab"" & ""cd"" <> ""abcd""")
121 Call ok("ab " & null
= "ab ", """ab"" & null = " & ("ab " & null
))
122 Call ok("ab " & empty
= "ab ", """ab"" & empty = " & ("ab " & empty
))
123 Call ok(1 & 100000 = "1100000", "1 & 100000 = " & (1 & 100000))
124 Call ok("ab" & x
= "abxx", """ab"" & x = " & ("ab"&x
))
126 if(isEnglishLang
) then
127 Call ok("" & true = "True", """"" & true = " & true)
128 Call ok(true & false = "TrueFalse", "true & false = " & (true & false))
131 call ok(true and true, "true and true is not true")
132 call ok(true and not false, "true and not false is not true")
133 call ok(not (false and true), "not (false and true) is not true")
134 call ok(getVT(null
and true) = "VT_NULL", "getVT(null and true) = " & getVT(null
and true))
136 call ok(false or true, "false or uie is false?")
137 call ok(not (false or false), "false or false is not false?")
138 call ok(false and false or true, "false and false or true is false?")
139 call ok(true or false and false, "true or false and false is false?")
140 call ok(null
or true, "null or true is false")
142 call ok(true xor
false, "true xor false is false?")
143 call ok(not (false xor
false), "false xor false is true?")
144 call ok(not (true or false xor
true), "true or false xor true is true?")
145 call ok(not (true xor
false or true), "true xor false or true is true?")
147 call ok(false eqv
false, "false does not equal false?")
148 call ok(not (false eqv
true), "false equals true?")
149 call ok(getVT(false eqv null
) = "VT_NULL", "getVT(false eqv null) = " & getVT(false eqv null
))
151 call ok(true imp
true, "true does not imp true?")
152 call ok(false imp
false, "false does not imp false?")
153 call ok(not (true imp
false), "true imp false?")
154 call ok(false imp null
, "false imp null is false?")
156 Call ok(2 >= 1, "! 2 >= 1")
157 Call ok(2 >= 2, "! 2 >= 2")
158 Call ok(not(true >= 2), "true >= 2 ?")
159 Call ok(2 > 1, "! 2 > 1")
160 Call ok(false > true, "! false < true")
161 Call ok(0 > true, "! 0 > true")
162 Call ok(not (true > 0), "true > 0")
163 Call ok(not (0 > 1 = 1), "0 > 1 = 1")
164 Call ok(1 < 2, "! 1 < 2")
165 Call ok(1 = 1 < 0, "! 1 = 1 < 0")
166 Call ok(1 <= 2, "! 1 <= 2")
167 Call ok(2 <= 2, "! 2 <= 2")
169 Call ok(isNull(0 = null
), "'(0 = null)' is not null")
170 Call ok(isNull(null
= 1), "'(null = 1)' is not null")
171 Call ok(isNull(0 > null
), "'(0 > null)' is not null")
172 Call ok(isNull(null
> 1), "'(null > 1)' is not null")
173 Call ok(isNull(0 < null
), "'(0 < null)' is not null")
174 Call ok(isNull(null
< 1), "'(null < 1)' is not null")
175 Call ok(isNull(0 <> null
), "'(0 <> null)' is not null")
176 Call ok(isNull(null
<> 1), "'(null <> 1)' is not null")
177 Call ok(isNull(0 >= null
), "'(0 >= null)' is not null")
178 Call ok(isNull(null
>= 1), "'(null >= 1)' is not null")
179 Call ok(isNull(0 <= null
), "'(0 <= null)' is not null")
180 Call ok(isNull(null
<= 1), "'(null <= 1)' is not null")
183 Call ok(2+2 = 4, "2+2 = " & (2+2))
184 Call ok(false + 6 + true = 5, "false + 6 + true <> 5")
185 Call ok(getVT(2+null
) = "VT_NULL", "getVT(2+null) = " & getVT(2+null
))
186 Call ok(2+empty
= 2, "2+empty = " & (2+empty
))
187 Call ok(x
+x
= 6, "x+x = " & (x
+x
))
189 Call ok(5-1 = 4, "5-1 = " & (5-1))
190 Call ok(3+5-true = 9, "3+5-true <> 9")
191 Call ok(getVT(2-null
) = "VT_NULL", "getVT(2-null) = " & getVT(2-null
))
192 Call ok(2-empty
= 2, "2-empty = " & (2-empty
))
193 Call ok(2-x
= -1, "2-x = " & (2-x
))
195 Call ok(9 Mod
6 = 3, "9 Mod 6 = " & (9 Mod
6))
196 Call ok(11.6 Mod
5.5 = False, "11.6 Mod 5.5 = " & (11.6 Mod
5.5 = 0.6))
197 Call ok(7 Mod
4+2 = 5, "7 Mod 4+2 <> 5")
198 Call ok(getVT(2 mod null
) = "VT_NULL", "getVT(2 mod null) = " & getVT(2 mod null
))
199 Call ok(getVT(null mod
2) = "VT_NULL", "getVT(null mod 2) = " & getVT(null mod
2))
200 'FIXME: Call ok(empty mod 2 = 0, "empty mod 2 = " & (empty mod 2))
202 Call ok(5 \
2 = 2, "5 \ 2 = " & (5\
2))
203 Call ok(4.6 \
1.5 = 2, "4.6 \ 1.5 = " & (4.6\
1.5))
204 Call ok(4.6 \
1.49 = 5, "4.6 \ 1.49 = " & (4.6\
1.49))
205 Call ok(2+3\
4 = 2, "2+3\4 = " & (2+3\
4))
207 Call ok(2*3 = 6, "2*3 = " & (2*3))
208 Call ok(3/2 = 1.5, "3/2 = " & (3/2))
209 Call ok(5\
4/2 = 2, "5\4/2 = " & (5\
2/1))
210 Call ok(12/3\
2 = 2, "12/3\2 = " & (12/3\
2))
211 Call ok(5/1000000 = 0.000005, "5/1000000 = " & (5/1000000))
213 Call ok(2^
3 = 8, "2^3 = " & (2^
3))
214 Call ok(2^
3^
2 = 64, "2^3^2 = " & (2^
3^
2))
215 Call ok(-3^
2 = 9, "-3^2 = " & (-3^
2))
216 Call ok(2*3^
2 = 18, "2*3^2 = " & (2*3^
2))
225 if true then y
= true : x
= y
228 x
= true : if false then x
= false
229 ok x
, "x is false, if false called?"
231 if not false then x
= true
232 ok x
, "x is false, if not false not called?"
234 if not false then x
= "test" : x
= true
235 ok x
, "x is false, if not false not called?"
237 if false then x
= y
: call ok(false, "if false .. : called")
239 if false then x
= y
: call ok(false, "if false .. : called") else x
= "else"
240 Call ok(x
= "else", "else not called?")
242 if true then x
= y
else y
= x
: Call ok(false, "in else?")
246 if false then x
= y
: if true then call ok(false, "embedded if called")
248 if false then x
=1 else x
=2 end if
249 if true then x
=1 end if
252 if false then x
= true : x
= true
253 Call ok(x
= false, "x <> false")
256 ok
false, "if false called"
263 Call ok(not x
, "x is false, if not evaluated?")
267 Call ok(false, "inside if false")
271 Call ok(x
, "else not called?")
275 Call ok(false, "inside if false")
277 Call ok(false, "inside elseif not true")
281 Call ok(x
, "else not called?")
285 Call ok(false, "inside if false")
288 ElseIf not False Then
291 Call ok(false, "inside else not true")
293 Call ok(x
, "elseif not called?")
297 Call ok(false, "inside if false")
298 ElseIf not False Then
301 Call ok(x
, "elseif not called?")
305 Call ok(x
, "if 1 not run?")
308 if &h10000
& then x
= true
309 Call ok(x
, "if &h10000& not run?")
319 call ok((x
and y
), "x or y is false after while")
341 ok
false, "if empty executed"
345 ok
false, "while empty executed"
349 WHILE x
< 3 : x
= x
+ 1
351 Call ok(x
= 3, "x not equal to 3")
362 do while not (x
and y
)
368 call ok((x
and y
), "x or y is false after while")
375 ok
false, "exit do didn't work"
379 Do While x
< 2 : x
= x
+ 1
381 Call ok(x
= 2, "x not equal to 2")
387 Call ok(x
= -3, "x not equal to -3")
397 call ok((x
and y
), "x or y is false after do until")
404 ok
false, "exit do didn't work"
410 Call ok(x
= 4, "x not equal to 4")
417 Call ok(x
= 40, "x not equal to 40")
425 call ok(x
, "x is false after do..loop?")
433 Call ok(x
= 6, "x not equal to 6")
443 call ok((x
and y
), "x or y is false after while")
450 ok
false, "exit do didn't work"
460 loop while not (x
and y
)
461 call ok((x
and y
), "x or y is false after while")
468 ok
false, "exit do didn't work"
475 Call ok(y
= "for1: 5 6 7 8", "y = " & y
)
478 for x
= 5 to 8 step
2
481 Call ok(y
= "for2: 5 7", "y = " & y
)
488 Call ok(y
= "for3: 5 6 7 8", "y = " & y
)
494 Call ok(y
= "for4:", "y = " & y
)
497 for x
= 5 to 3 step
true
500 Call ok(y
= "for5: 5 4 3", "y = " & y
)
504 for x
= 5 to z step
3-4
508 Call ok(y
= "for6: 5 4", "y = " & y
)
512 for x
= 5 to 8 step z
516 Call ok(y
= "for7: 5 6 7 8", "y = " & y
)
519 For x
= 10 To 18 Step
2 : : z
= z
+ 1
521 Call ok(z
= 5, "z not equal to 5")
528 Call ok(y
= "for8: 5 7", "y = " & y
)
531 Call ok(false, "for..to called when unexpected")
536 Call ok(false, "exit for not escaped the loop?")
542 Call ok(false, "exit for not escaped the loop?")
551 if null
then call ok(false, "if null evaluated")
554 call ok(false, "while null evaluated")
557 Call collectionObj
.reset()
559 for each x
in collectionObj
:
563 Call ok(y
= 9, "y = " & y
)
565 Call collectionObj
.reset()
569 for each x
in collectionObj
: z
= z
+ 2
571 Call ok(x
= y
, "x <> y")
573 Call ok(y
= 3, "y = " & y
)
574 Call ok(z
= 6, "z = " & z
)
575 Call ok(getVT(x
) = "VT_EMPTY*", "getVT(x) = " & getVT(x
))
577 Call collectionObj
.reset()
579 for each x
in collectionObj
580 if x
= 2 then exit for
583 Call ok(y
= 1, "y = " & y
)
584 Call ok(x
= 2, "x = " & x
)
586 Set obj
= collectionObj
592 Call ok(x
= y
, "x <> y")
594 Call ok(y
= 3, "y = " & y
)
595 Call ok(getVT(x
) = "VT_EMPTY*", "getVT(x) = " & getVT(x
))
600 Call ok(false, "unexpected case")
602 Call ok(false, "unexpected case")
604 Call ok(false, "unexpected case")
607 Call ok(false, "unexpected case")
608 case 0, false, 2+1, 10
610 case ok(false, "unexpected case")
611 Call ok(false, "unexpected case")
613 Call ok(false, "unexpected case")
615 Call ok(x
, "wrong case")
622 Call ok(x
, "wrong case")
627 Call ok(false, "unexpected case")
631 Call ok(x
, "wrong case")
639 Call ok(false, "unexpected case")
641 Call ok(x
, "wrong case")
645 Call ok(false, "unexpected case")
647 Call ok(false, "unexpected case")
655 case 3,1,2,4: x
= true
657 Call ok(false, "unexpected case")
659 Call ok(x
, "wrong case")
662 select case 2: case 5,6,7: Call ok(false, "unexpected case")
665 case else: Call ok(false, "unexpected case else")
667 Call ok(x
, "wrong case")
677 Call ok(false, "unexpected case") :
682 Call ok(x
, "wrong case")
692 Call ok(x
, "x is false, testsub not called?")
695 Call ok(not v
, "v is not true")
701 Call ok(x
, "x was not set by SubSetTrue")
704 Call ok(not false, "false is no longer false?")
706 Sub SubSetTrue2(ByRef v
)
707 Call ok(not v
, "v is not true")
713 Call ok(x
, "x was not set by SubSetTrue")
715 Sub TestSubArgVal(ByVal v
)
716 Call ok(not v
, "v is not false")
718 Call ok(v
, "v is not true?")
722 Call TestSubArgVal(x
)
723 Call ok(not x
, "x is true after TestSubArgVal call?")
725 Sub TestSubMultiArgs(a
,b
,c
,d
,e
)
726 Call ok(a
=1, "a = " & a
)
727 Call ok(b
=2, "b = " & b
)
728 Call ok(c
=3, "c = " & c
)
729 Call ok(d
=4, "d = " & d
)
730 Call ok(e
=5, "e = " & e
)
733 Sub TestSubExit(ByRef a
)
737 Call ok(false, "Exit Sub not called?")
740 Call TestSubExit(true)
749 TestSubMultiArgs
1, 2, 3, 4, 5
750 Call TestSubMultiArgs(1, 2, 3, 4, 5)
754 Call ok(not x
, "local x is not false?")
762 Call ok(x
, "global x is not true?")
764 Public Sub TestPublicSub
768 Private Sub TestPrivateSub
772 Public Sub TestSeparatorSub
: :
775 Call TestSeparatorSub
785 Call ok(x
, "x is false, testfunc not called?")
787 Function FuncSetTrue(v
)
788 Call ok(not v
, "v is not true")
794 Call ok(x
, "x was not set by FuncSetTrue")
797 Call ok(not false, "false is no longer false?")
799 Function FuncSetTrue2(ByRef v
)
800 Call ok(not v
, "v is not true")
806 Call ok(x
, "x was not set by FuncSetTrue")
808 Function TestFuncArgVal(ByVal v
)
809 Call ok(not v
, "v is not false")
811 Call ok(v
, "v is not true?")
815 Call TestFuncArgVal(x
)
816 Call ok(not x
, "x is true after TestFuncArgVal call?")
818 Function TestFuncMultiArgs(a
,b
,c
,d
,e
)
819 Call ok(a
=1, "a = " & a
)
820 Call ok(b
=2, "b = " & b
)
821 Call ok(c
=3, "c = " & c
)
822 Call ok(d
=4, "d = " & d
)
823 Call ok(e
=5, "e = " & e
)
826 TestFuncMultiArgs
1, 2, 3, 4, 5
827 Call TestFuncMultiArgs(1, 2, 3, 4, 5)
829 Function TestFuncLocalVal
831 Call ok(not x
, "local x is not false?")
837 Call TestFuncLocalVal
838 Call ok(x
, "global x is not true?")
840 Function TestFuncExit(ByRef a
)
844 Call ok(false, "Exit Function not called?")
847 Call TestFuncExit(true)
849 Function TestFuncExit2(ByRef a
)
855 Call ok(false, "Exit Function not called?")
858 Call TestFuncExit2(true)
864 Function FuncParseTest
865 End Function : x
= false
872 Call ok(ReturnTrue(), "ReturnTrue returned false?")
874 Function SetVal(ByRef x
, ByVal v
)
881 ok
SetVal(x
, true), "SetVal returned false?"
882 Call ok(x
, "x is not set to true by SetVal?")
884 Public Function TestPublicFunc
888 Private Function TestPrivateFunc
892 Public Function TestSepFunc(ByVal a
) : :
895 Call ok(TestSepFunc(1) = 1, "Function did not return 1")
897 ok
duplicatedfunc() = 2, "duplicatedfunc = " & duplicatedfunc()
899 function duplicatedfunc
900 ok
false, "duplicatedfunc called"
904 ok
false, "duplicatedfunc called"
907 function duplicatedfunc
911 ok
duplicatedfunc() = 2, "duplicatedfunc = " & duplicatedfunc()
913 ' Stop has an effect only in debugging mode
917 Call ok(getVT(x
) = "VT_DISPATCH*", "getVT(x=testObj) = " & getVT(x
))
919 Set obj
= New EmptyClass
920 Call ok(getVT(obj
) = "VT_DISPATCH*", "getVT(obj) = " & getVT(obj
))
926 Call ok(getVT(x
) = "VT_DISPATCH*", "getVT(x) = " & getVT(x
))
933 Public Function publicFunction()
938 Public Property Get gsProp()
940 funcCalled
= "gsProp get"
942 Call ok(false, "exit property not returned?")
945 Public Default
Property Get DefValGet
946 DefValGet
= privateProp
947 funcCalled
= "GetDefVal"
950 Public Property Let DefValGet(x
)
958 Public Property Let gsProp(val
)
960 funcCalled
= "gsProp let"
962 Call ok(false, "exit property not returned?")
965 Public Property Set gsProp(val
)
966 funcCalled
= "gsProp set"
968 Call ok(false, "exit property not returned?")
971 Public Sub setPrivateProp(x
)
975 Function getPrivateProp
976 getPrivateProp
= privateProp
979 Private Sub privateSub
982 Public Sub Class_Initialize
985 Call ok(getVT(privateProp
) = "VT_BOOL*", "getVT(privateProp) = " & getVT(privateProp
))
986 Call ok(getVT(publicProp2
) = "VT_I2*", "getVT(publicProp2) = " & getVT(publicProp2
))
987 Call ok(getVT(Me.publicProp2
) = "VT_I2", "getVT(Me.publicProp2) = " & getVT(Me.publicProp2
))
990 Property Get gsGetProp(x
)
995 Call testDisp(new testClass
)
997 Set obj
= New TestClass
999 Call ok(obj
.publicFunction
= 4, "obj.publicFunction = " & obj
.publicFunction
)
1000 Call ok(obj
.publicFunction() = 4, "obj.publicFunction() = " & obj
.publicFunction())
1004 Call obj
.publicFunction()
1006 Call ok(getVT(obj
.publicProp
) = "VT_EMPTY", "getVT(obj.publicProp) = " & getVT(obj
.publicProp
))
1008 Call ok(getVT(obj
.publicProp
) = "VT_I2", "getVT(obj.publicProp) = " & getVT(obj
.publicProp
))
1009 Call ok(obj
.publicProp
= 3, "obj.publicProp = " & obj
.publicProp
)
1010 obj
.publicProp() = 3
1012 Call ok(obj
.getPrivateProp() = true, "obj.getPrivateProp() = " & obj
.getPrivateProp())
1013 Call obj
.setPrivateProp(6)
1014 Call ok(obj
.getPrivateProp
= 6, "obj.getPrivateProp = " & obj
.getPrivateProp
)
1018 Call ok(obj
.gsProp
= 6, "obj.gsProp = " & obj
.gsProp
)
1019 Call ok(funcCalled
= "gsProp get", "funcCalled = " & funcCalled
)
1021 Call ok(funcCalled
= "gsProp let", "funcCalled = " & funcCalled
)
1022 Call ok(obj
.getPrivateProp
= 3, "obj.getPrivateProp = " & obj
.getPrivateProp
)
1023 Set obj
.gsProp
= New testclass
1024 Call ok(funcCalled
= "gsProp set", "funcCalled = " & funcCalled
)
1027 Call ok(x
= 3, "(x = obj) = " & x
)
1028 Call ok(funcCalled
= "GetDefVal", "funcCalled = " & funcCalled
)
1030 Call ok(obj
= 3, "(x = obj) = " & obj
)
1031 Call ok(funcCalled
= "GetDefVal", "funcCalled = " & funcCalled
)
1033 Call obj
.Class_Initialize
1034 Call ok(obj
.getPrivateProp() = true, "obj.getPrivateProp() = " & obj
.getPrivateProp())
1036 x
= (New testclass
).publicProp
1039 Public Sub Class_Terminate()
1040 funcCalled
= "terminate"
1044 Set obj
= New TermTest
1047 Call ok(funcCalled
= "terminate", "funcCalled = " & funcCalled
)
1049 Set obj
= New TermTest
1051 Call obj
.Class_Terminate
1052 Call ok(funcCalled
= "terminate", "funcCalled = " & funcCalled
)
1055 Call ok(funcCalled
= "terminate", "funcCalled = " & funcCalled
)
1057 Call (New testclass
).publicSub()
1058 Call (New testclass
).publicSub
1061 property get prop0()
1065 property get prop1(x
)
1069 property get prop2(x
, y
)
1074 set obj
= new PropTest
1076 call ok(obj
.prop0
= 1, "obj.prop0 = " & obj
.prop0
)
1077 call ok(obj
.prop1(3) = 4, "obj.prop1(3) = " & obj
.prop1(3))
1078 call ok(obj
.prop2(3,4) = 7, "obj.prop2(3,4) = " & obj
.prop2(3,4))
1083 x
= "following ':' is correct syntax" :
1084 x
= "following ':' is correct syntax" :: :
1085 :: x
= "also correct syntax"
1086 rem another ugly way for comments
1087 x
= "rem as simplestatement" : rem rem comment
1090 Set obj
= new EmptyClass
1092 Set y
= new EmptyClass
1094 Call ok(obj is x
, "obj is not x")
1095 Call ok(x is obj
, "x is not obj")
1096 Call ok(not (obj is y
), "obj is not y")
1097 Call ok(not obj is y
, "obj is not y")
1098 Call ok(not (x is
Nothing), "x is 1")
1099 Call ok(Nothing is
Nothing, "Nothing is not Nothing")
1100 Call ok(x is obj
and true, "x is obj and true is false")
1103 Public Sub Test(MyMe
)
1104 Call ok(Me is MyMe
, "Me is not MyMe")
1108 Set obj
= New TestMe
1111 Call ok(getVT(test
) = "VT_DISPATCH", "getVT(test) = " & getVT(test
))
1112 Call ok(Me is Test
, "Me is not Test")
1114 Const c1
= 1, c2
= 2, c3
= -3
1115 Call ok(c1
= 1, "c1 = " & c1
)
1116 Call ok(getVT(c1
) = "VT_I2", "getVT(c1) = " & getVT(c1
))
1117 Call ok(c3
= -3, "c3 = " & c3
)
1118 Call ok(getVT(c3
) = "VT_I2", "getVT(c3) = " & getVT(c3
))
1120 Const cb
= True, cs
= "test", cnull
= null
1121 Call ok(cb
, "cb = " & cb
)
1122 Call ok(getVT(cb
) = "VT_BOOL", "getVT(cb) = " & getVT(cb
))
1123 Call ok(cs
= "test", "cs = " & cs
)
1124 Call ok(getVT(cs
) = "VT_BSTR", "getVT(cs) = " & getVT(cs
))
1125 Call ok(isNull(cnull
), "cnull = " & cnull
)
1126 Call ok(getVT(cnull
) = "VT_NULL", "getVT(cnull) = " & getVT(cnull
))
1128 Call ok(+1 = 1, "+1 != 1")
1129 Call ok(+true = true, "+1 != 1")
1130 Call ok(getVT(+true) = "VT_BOOL", "getVT(+true) = " & getVT(+true))
1131 Call ok(+"true" = "true", """+true"" != true")
1132 Call ok(getVT(+"true") = "VT_BSTR", "getVT(+""true"") = " & getVT(+"true"))
1133 Call ok(+obj is obj
, "+obj != obj")
1134 Call ok(+--+-+1 = -1, "+--+-+1 != -1")
1136 if false then Const conststr
= "str"
1137 Call ok(conststr
= "str", "conststr = " & conststr
)
1138 Call ok(getVT(conststr
) = "VT_BSTR", "getVT(conststr) = " & getVT(conststr
))
1139 Call ok(conststr
= "str", "conststr = " & conststr
)
1143 Call ok(c1
= 1, "c1 = " & c1
)
1144 Call ok(funcconst
= 1, "funcconst = " & funcconst
)
1150 ' Property may be used as an identifier (although it's a keyword)
1154 Call ok(property, "property = " & property)
1156 for property = 1 to 2
1163 Public Sub Property()
1166 Sub Test(byref property)
1177 Sub Test2(byval property)
1181 Class SeparatorTest
: : Dim varTest1
1183 Private Sub Class_Initialize
: varTest1
= 1
1186 Property Get Test1() :
1190 Property Let Test1(a
) :
1194 Public Function AddToTest1(ByVal a
) :: :
1195 varTest1
= varTest1
+ a
1196 AddToTest1
= varTest1
1197 End Function : End Class
: :: Set obj
= New SeparatorTest
1199 Call ok(obj
.Test1
= 1, "obj.Test1 is not 1")
1201 Call ok(obj
.Test1
= 6, "obj.Test1 is not 6")
1203 Call ok(obj
.Test1
= 11, "obj.Test1 is not 11")
1207 call ok(getVT(obj
) = "VT_UNKNOWN*", "getVT(obj) = " & getVT(obj
))
1208 call ok(getVT(x
) = "VT_UNKNOWN*", "getVT(x) = " & getVT(x
))
1209 call ok(getVT(unkObj
) = "VT_UNKNOWN", "getVT(unkObj) = " & getVT(unkObj
))
1210 call ok(obj is unkObj
, "obj is not unkObj")
1214 Call ok(getVT(arr
) = "VT_EMPTY*", "getVT(arr) = " & getVT(arr
))
1217 Dim arr2(4,3), arr3(5,4,3), arr0(0), noarr()
1219 Call ok(getVT(arr
) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(arr) = " & getVT(arr
))
1220 Call ok(getVT(arr2
) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(arr2) = " & getVT(arr2
))
1221 Call ok(getVT(arr0
) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(arr0) = " & getVT(arr0
))
1222 Call ok(getVT(noarr
) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(noarr) = " & getVT(noarr
))
1224 Call testArray(1, arr
)
1225 Call testArray(2, arr2
)
1226 Call testArray(3, arr3
)
1227 Call testArray(0, arr0
)
1228 Call testArray(-1, noarr
)
1230 Call ok(getVT(arr(1)) = "VT_EMPTY*", "getVT(arr(1)) = " & getVT(arr(1)))
1231 Call ok(getVT(arr2(1,2)) = "VT_EMPTY*", "getVT(arr2(1,2)) = " & getVT(arr2(1,2)))
1232 Call ok(getVT(arr3(1,2,2)) = "VT_EMPTY*", "getVT(arr3(1,2,3)) = " & getVT(arr3(1,2,2)))
1233 Call ok(getVT(arr(0)) = "VT_EMPTY*", "getVT(arr(0)) = " & getVT(arr(0)))
1234 Call ok(getVT(arr(3)) = "VT_EMPTY*", "getVT(arr(3)) = " & getVT(arr(3)))
1235 Call ok(getVT(arr0(0)) = "VT_EMPTY*", "getVT(arr0(0)) = " & getVT(arr0(0)))
1238 Call ok(arr(2) = 3, "arr(2) = " & arr(2))
1239 Call ok(getVT(arr(2)) = "VT_I2*", "getVT(arr(2)) = " & getVT(arr(2)))
1243 Call ok(arr3(3,2,1) = 1, "arr3(3,2,1) = " & arr3(3,2,1))
1244 Call ok(arr3(1,2,3) = 2, "arr3(1,2,3) = " & arr3(1,2,3))
1246 Call ok(arr2(4,3) = 1, "arr2(4,3) = " & arr2(4,3))
1249 Call ok(x(3,2,1) = 1, "x(3,2,1) = " & x(3,2,1))
1259 Call ok(getVT(x
) = "VT_ARRAY|VT_VARIANT*", "getVT(x) = " & getVT(x
))
1260 Call ok(x(2) = 2, "x(2) = " & x(2))
1261 Call ok(getVT(x(3)) = "VT_EMPTY*", "getVT(x(3)) = " & getVT(x(3)))
1264 Call ok(x(1) = 1, "x(1) = " & x(1))
1266 Call ok(getVT(x(1)) = "VT_EMPTY*", "getVT(x(1)) = " & getVT(x(1)))
1267 Call ok(x(2) = 2, "x(2) = " & x(2))
1272 Call ok(y(1) = 1, "y(1) = " & y(1))
1277 Call ok(getVT(forarr(1)) = "VT_EMPTY*", "getVT(forarr(1)) = " & getVT(forarr(1)))
1279 Call ok(forarr(1) = x
, "forarr(1) = " & forarr(1))
1285 Call ok(forarr(x
) = 2, "forarr(x) = " & forarr(x
))
1288 ok
arr(1) = 1, "arr(1) = " & arr(1)
1293 ok
arr(1) = 2, "arr(1) = " & arr(1)
1296 ok
arr2(x
,y
) = 1, "arr2(x,y) = " & arr2(x
,y
)
1301 call accessArr2(1, 2)
1302 ok
arr2(1,2) = 2, "arr2(1,2) = " & arr2(1,2)
1305 call ok(x(0)(0) = 3, "x(0)(0) = " & x(0)(0))
1314 ok
x(0) = 2, "x(0) = " & x(0)
1318 ok
x(0) = 1, "x(0) = " & x(0)
1321 call (((seta0
))) ((x
))
1322 ok
x(0) = 1, "x(0) = " & x(0)
1325 call (((seta0
))) (x
)
1326 ok
x(0) = 2, "x(0) = " & x(0)
1330 call ok(x(0)(0) = 2, "x(0)(0) = " & x(0)(0))
1334 call ok(x(0)(0) = 3, "x(0)(0) = " & x(0)(0))
1337 ok y
= 1, "y = " & y
1340 ok y
= 2, "y = " & y
1348 ok
x(0) = 2, "x(0) = " & x(0)
1349 ok
getVT(x
) = "VT_ARRAY|VT_VARIANT*", "getVT(x) after redim = " & getVT(x
)
1353 ok
x(0) = 1, "x(0) = " & x(0)
1357 ok
ubound(x
) = 4, "ubound(x) = " & ubound(x
)
1358 ok
x(0) = empty
, "x(0) = " & x(0)
1362 ok
ubound(x
) = 3, "ubound(x) = " & ubound(x
)
1366 ok
lbound(x
) = 0, "lbound(x) = " & lbound(x
)
1367 ok
ubound(x
) = -1, "ubound(x) = " & ubound(x
)
1370 ok
ubound(x
) = 3, "ubound(x) = " & ubound(x
)
1371 ok
ubound(x
, 1) = 3, "ubound(x, 1) = " & ubound(x
, 1)
1372 ok
ubound(x
, 2) = 2, "ubound(x, 2) = " & ubound(x
, 2) & " expected 2"
1375 on error resume next
1376 redim staticarray(3)
1379 todo_wine_ok e
= 10, "e = " & e
1386 Private Sub Class_Initialize
1387 Call ok(getVT(classarr
) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(classarr) = " & getVT(classarr
))
1388 Call testArray(-1, classnoarr
)
1395 Public Sub testVarVT
1396 Call ok(getVT(var
) = "VT_ARRAY|VT_VARIANT*", "getVT(var) = " & getVT(var
))
1400 Set obj
= new ArrClass
1401 Call ok(getVT(obj
.classarr
) = "VT_ARRAY|VT_VARIANT", "getVT(obj.classarr) = " & getVT(obj
.classarr
))
1402 'todo_wine Call ok(obj.classarr(1) = 2, "obj.classarr(1) = " & obj.classarr(1))
1405 Call ok(getVT(obj
.var
) = "VT_ARRAY|VT_VARIANT", "getVT(obj.var) = " & getVT(obj
.var
))
1408 Sub arrarg(byref refarr
, byval valarr
, byref refarr2
, byval valarr2
)
1409 Call ok(getVT(refarr
) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(refarr) = " & getVT(refarr
))
1410 Call ok(getVT(valarr
) = "VT_ARRAY|VT_VARIANT*", "getVT(valarr) = " & getVT(valarr
))
1411 Call ok(getVT(refarr2
) = "VT_ARRAY|VT_VARIANT*", "getVT(refarr2) = " & getVT(refarr2
))
1412 Call ok(getVT(valarr2
) = "VT_ARRAY|VT_VARIANT*", "getVT(valarr2) = " & getVT(valarr2
))
1415 Call arrarg(arr
, arr
, obj
.classarr
, obj
.classarr
)
1417 Sub arrarg2(byref refarr(), byval valarr(), byref refarr2(), byval valarr2())
1418 Call ok(getVT(refarr
) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(refarr) = " & getVT(refarr
))
1419 Call ok(getVT(valarr
) = "VT_ARRAY|VT_VARIANT*", "getVT(valarr) = " & getVT(valarr
))
1420 Call ok(getVT(refarr2
) = "VT_ARRAY|VT_VARIANT*", "getVT(refarr2) = " & getVT(refarr2
))
1421 Call ok(getVT(valarr2
) = "VT_ARRAY|VT_VARIANT*", "getVT(valarr2) = " & getVT(valarr2
))
1424 Call arrarg2(arr
, arr
, obj
.classarr
, obj
.classarr
)
1426 Sub testarrarg(arg(), vt
)
1427 Call ok(getVT(arg
) = vt
, "getVT() = " & getVT(arg
) & " expected " & vt
)
1430 Call testarrarg(1, "VT_I2*")
1431 Call testarrarg(false, "VT_BOOL*")
1432 Call testarrarg(Empty
, "VT_EMPTY*")
1435 Call ok(arr(0) = "not modified", "arr(0) = " & arr(0))
1439 arr(0) = "not modified"
1441 Call ok(arr(0) = "modified", "arr(0) = " & arr(0))
1443 arr(0) = "not modified"
1445 Call ok(arr(0) = "not modified", "arr(0) = " & arr(0))
1447 for x
= 0 to UBound(arr
)
1452 Call ok(x
= y
, "x = " & x
& ", expected " & y
)
1453 Call ok(arr(y
) = y
, "arr(" & y
& ") = " & arr(y
))
1458 Call ok(y
= 4, "y = " & y
& " after array enumeration")
1460 for x
=0 to UBound(arr2
, 1)
1461 for y
=0 to UBound(arr2
, 2)
1462 arr2(x
, y
) = x
+ y
*(UBound(arr2
, 1)+1)
1467 Call ok(x
= y
, "x = " & x
& ", expected " & y
)
1470 Call ok(y
= 20, "y = " & y
& " after array enumeration")
1473 Call ok(false, "Empty array contains: " & x
)
1476 ' It's allowed to declare non-builtin RegExp class...
1478 public property get Global()
1479 Call ok(false, "Global called")
1484 ' ...but there is no way to use it because builtin instance is always created
1486 Call ok(x
.Global = false, "x.Global = " & x
.Global)
1488 sub test_nothing_errors
1490 on error resume next
1495 call ok(err
.number
= 91, "err.number = " & err
.number
)
1496 call ok(x
= 1, "x = " & x
)
1500 call ok(err
.number
= 91, "err.number = " & err
.number
)
1501 call ok(x
= 1, "x = " & x
)
1505 call ok(err
.number
= 91, "err.number = " & err
.number
)
1506 call ok(x
= 1, "x = " & x
)
1508 call test_nothing_errors()
1510 sub test_identifiers
1511 ' test keywords that can also be a declared identifier
1514 Call ok(default
= "xx", "default = " & default
& " expected ""xx""")
1518 Call ok(error = "xx", "error = " & error & " expected ""xx""")
1522 Call ok(explicit = "xx", "explicit = " & explicit & " expected ""xx""")
1526 Call ok(step
= "xx", "step = " & step
& " expected ""xx""")
1528 call test_identifiers()
1530 sub test_dotIdentifiers
1531 ' test keywords that can also be an identifier after a dot
1532 Call ok(testObj
.rem = 10, "testObj.rem = " & testObj.rem & " expected 10")
1533 Call ok(testObj
.true = 10, "testObj.true = " & testObj
.true & " expected 10")
1534 Call ok(testObj
.false = 10, "testObj.false = " & testObj
.false & " expected 10")
1535 Call ok(testObj
.not = 10, "testObj.not = " & testObj
.not & " expected 10")
1536 Call ok(testObj
.and = 10, "testObj.and = " & testObj
.and & " expected 10")
1537 Call ok(testObj
.or = 10, "testObj.or = " & testObj
.or & " expected 10")
1538 Call ok(testObj
.xor
= 10, "testObj.xor = " & testObj
.xor
& " expected 10")
1539 Call ok(testObj
.eqv
= 10, "testObj.eqv = " & testObj
.eqv
& " expected 10")
1540 Call ok(testObj
.imp
= 10, "testObj.imp = " & testObj
.imp
& " expected 10")
1541 Call ok(testObj
.is
= 10, "testObj.is = " & testObj
.is
& " expected 10")
1542 Call ok(testObj
.mod
= 10, "testObj.mod = " & testObj
.mod
& " expected 10")
1543 Call ok(testObj
.call = 10, "testObj.call = " & testObj
.call & " expected 10")
1544 Call ok(testObj
.dim = 10, "testObj.dim = " & testObj
.dim & " expected 10")
1545 Call ok(testObj
.sub = 10, "testObj.sub = " & testObj
.sub & " expected 10")
1546 Call ok(testObj
.function = 10, "testObj.function = " & testObj
.function & " expected 10")
1547 Call ok(testObj
.get = 10, "testObj.get = " & testObj
.get & " expected 10")
1548 Call ok(testObj
.let = 10, "testObj.let = " & testObj
.let & " expected 10")
1549 Call ok(testObj
.const = 10, "testObj.const = " & testObj
.const & " expected 10")
1550 Call ok(testObj
.if = 10, "testObj.if = " & testObj
.if & " expected 10")
1551 Call ok(testObj
.else = 10, "testObj.else = " & testObj
.else & " expected 10")
1552 Call ok(testObj
.elseif = 10, "testObj.elseif = " & testObj
.elseif & " expected 10")
1553 Call ok(testObj
.end = 10, "testObj.end = " & testObj
.end & " expected 10")
1554 Call ok(testObj
.then = 10, "testObj.then = " & testObj
.then & " expected 10")
1555 Call ok(testObj
.exit = 10, "testObj.exit = " & testObj
.exit & " expected 10")
1556 Call ok(testObj
.while = 10, "testObj.while = " & testObj
.while & " expected 10")
1557 Call ok(testObj
.wend = 10, "testObj.wend = " & testObj
.wend & " expected 10")
1558 Call ok(testObj
.do = 10, "testObj.do = " & testObj
.do & " expected 10")
1559 Call ok(testObj
.loop = 10, "testObj.loop = " & testObj
.loop & " expected 10")
1560 Call ok(testObj
.until = 10, "testObj.until = " & testObj
.until & " expected 10")
1561 Call ok(testObj
.for = 10, "testObj.for = " & testObj
.for & " expected 10")
1562 Call ok(testObj
.to = 10, "testObj.to = " & testObj
.to & " expected 10")
1563 Call ok(testObj
.each = 10, "testObj.each = " & testObj
.each & " expected 10")
1564 Call ok(testObj
.in = 10, "testObj.in = " & testObj
.in & " expected 10")
1565 Call ok(testObj
.select = 10, "testObj.select = " & testObj
.select & " expected 10")
1566 Call ok(testObj
.case = 10, "testObj.case = " & testObj
.case & " expected 10")
1567 Call ok(testObj
.byref = 10, "testObj.byref = " & testObj
.byref & " expected 10")
1568 Call ok(testObj
.byval = 10, "testObj.byval = " & testObj
.byval & " expected 10")
1569 Call ok(testObj
.option = 10, "testObj.option = " & testObj
.option & " expected 10")
1570 Call ok(testObj
.nothing = 10, "testObj.nothing = " & testObj
.nothing & " expected 10")
1571 Call ok(testObj
.empty
= 10, "testObj.empty = " & testObj
.empty
& " expected 10")
1572 Call ok(testObj
.null
= 10, "testObj.null = " & testObj
.null
& " expected 10")
1573 Call ok(testObj
.class
= 10, "testObj.class = " & testObj
.class
& " expected 10")
1574 Call ok(testObj
.set = 10, "testObj.set = " & testObj
.set & " expected 10")
1575 Call ok(testObj
.new = 10, "testObj.new = " & testObj
.new & " expected 10")
1576 Call ok(testObj
.public = 10, "testObj.public = " & testObj
.public & " expected 10")
1577 Call ok(testObj
.private = 10, "testObj.private = " & testObj
.private & " expected 10")
1578 Call ok(testObj
.next = 10, "testObj.next = " & testObj
.next & " expected 10")
1579 Call ok(testObj
.on = 10, "testObj.on = " & testObj
.on & " expected 10")
1580 Call ok(testObj
.resume = 10, "testObj.resume = " & testObj
.resume & " expected 10")
1581 Call ok(testObj
.goto = 10, "testObj.goto = " & testObj
.goto & " expected 10")
1582 Call ok(testObj
.with = 10, "testObj.with = " & testObj
.with & " expected 10")
1583 Call ok(testObj
.redim = 10, "testObj.redim = " & testObj
.redim & " expected 10")
1584 Call ok(testObj
.preserve = 10, "testObj.preserve = " & testObj
.preserve & " expected 10")
1585 Call ok(testObj
.property = 10, "testObj.property = " & testObj
.property & " expected 10")
1586 Call ok(testObj
.me = 10, "testObj.me = " & testObj
.me & " expected 10")
1587 Call ok(testObj
.stop = 10, "testObj.stop = " & testObj
.stop & " expected 10")
1589 call test_dotIdentifiers
1591 ' Test End statements not required to be preceded by a newline or separator
1595 Sub EndTestSubWithCall
1597 Call ok(x
= 1, "x = " & x
)End Sub
1598 Call EndTestSubWithCall()
1600 Function EndTestFunc(x
)
1601 Call ok(x
> 0, "x = " & x
)End Function
1604 Class EndTestClassWithStorageId
1607 Class EndTestClassWithDim
1610 Class EndTestClassWithFunc
1611 Function test(ByVal x
)
1612 x
= 0 End Function End Class
1614 Class EndTestClassWithProperty
1616 Public default
Property Get defprop
1617 defprop
= x
End Property End Class
1619 class TestPropSyntax
1626 public default
property get def()
1631 set x
= new TestPropSyntax
1632 set x
.prop
= new TestPropSyntax
1633 set x
.prop
.prop
= new TestPropSyntax
1634 x
.prop
.prop
.prop
= 2
1635 call ok(x
.getProp().getProp
.prop
= 2, "x.getProp().getProp.prop = " & x
.getProp().getProp
.prop
)
1636 x
.getprop
.getprop().prop
= 3
1637 call ok(x
.getProp
.prop
.prop
= 3, "x.getProp.prop.prop = " & x
.getProp
.prop
.prop
)
1638 set x
.getprop
.getprop().prop
= new emptyclass
1639 set obj
= new emptyclass
1640 set x
.getprop
.getprop().prop
= obj
1641 call ok(x
.getprop
.getprop().prop is obj
, "x.getprop.getprop().prop is not obj (emptyclass)")
1643 ok
getVT(x
) = "VT_DISPATCH*", "getVT(x) = " & getVT(x
)
1644 todo_wine_ok
getVT(x()) = "VT_BSTR", "getVT(x()) = " & getVT(x())
1649 set x
= new TestPropSyntax
1652 ok
.prop
= 1, ".prop = "&.prop
1654 ok x
.prop
= 1, "x.prop = " & x
.prop
1656 with new TestPropSyntax
1658 ok
.prop
= 1, ".prop = "&.prop
1661 function testsetresult(x
, y
)
1662 set testsetresult
= new TestPropSyntax
1663 testsetresult
.prop
= x
1664 y
= testsetresult
.prop
+ 1
1667 set x
= testsetresult(1, 2)
1668 ok x
.prop
= 1, "x.prop = " & x
.prop
1670 set arr(0) = new TestPropSyntax
1672 ok
arr(0).prop
= 1, "arr(0) = " & arr(0).prop
1680 ok x
= true, "x = " & x