diff --git a/dlls/vbscript/tests/error.vbs b/dlls/vbscript/tests/error.vbs index 78314c35699..13f9a2072ee 100644 --- a/dlls/vbscript/tests/error.vbs +++ b/dlls/vbscript/tests/error.vbs @@ -77,6 +77,13 @@ const CO_E_SERVER_EXEC_FAILURE = &h80080005& call ok(Err.Number = 0, "Err.Number = " & Err.Number) call ok(getVT(Err.Number) = "VT_I4", "getVT(Err.Number) = " & getVT(Err.Number)) +class emptyclass +end class + +class propclass + public prop +end class + dim calledFunc sub returnTrue @@ -313,6 +320,70 @@ end sub call testForEachError() +sub testWithError() + on error resume next + dim x + + err.clear + x = false + with throwInt(E_TESTERROR) + ok Err.Number = E_TESTERROR, "Err.Number = " & Err.Number + x = true + end with + ok x, "with statement body not executed" + + err.clear + x = false + with throwInt(E_TESTERROR) + x = true + .prop = 1 + todo_wine_ok Err.Number = 424, "Err.Number = " & Err.Number + end with + ok x, "with statement body not executed" + + err.clear + x = false + with empty + .prop = 1 + todo_wine_ok Err.Number = 424, "Err.Number = " & Err.Number + x = true + end with + ok x, "with statement body not executed" +end sub + +sub testWithError2() + on error resume next + dim x + + err.clear + x = false + with new emptyclass + .prop = 1 + ok Err.Number = 438, "Err.Number = " & Err.Number + x = true + end with + ok x, "with statement body not executed" + + 'dot expression can reference only inner-most with statement + err.clear + x = false + with new propclass + with new emptyclass + .prop = 1 + ok Err.Number = 438, "Err.Number = " & Err.Number + x = true + end with + end with + ok x, "with statement body not executed" + + err.clear + .prop + ok Err.Number = 505, "Err.Number = " & Err.Number & " description """ & err.description & """" +end sub + +call testWithError() +call testWithError2() + sub testHresMap(hres, code) on error resume next diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 8027264bf5d..f7cdc92ec4e 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1568,4 +1568,19 @@ call ok(x.getProp.prop.prop = 3, "x.getProp.prop.prop = " & x.getProp.prop.prop) ok getVT(x) = "VT_DISPATCH*", "getVT(x) = " & getVT(x) todo_wine_ok getVT(x()) = "VT_BSTR", "getVT(x()) = " & getVT(x()) +with nothing +end with + +set x = new TestPropSyntax +with x + .prop = 1 + ok .prop = 1, ".prop = "&.prop +end with +ok x.prop = 1, "x.prop = " & x.prop + +with new TestPropSyntax + .prop = 1 + ok .prop = 1, ".prop = "&.prop +end with + reportSuccess() diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 2c0ccdd25b2..19b562852db 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -2920,6 +2920,18 @@ static void run_tests(void) CHECK_CALLED(global_propargput1_d); CHECK_CALLED(global_propargput1_i); + SET_EXPECT(testobj_propget_d); + SET_EXPECT(testobj_propget_i); + parse_script_a("dim x\nwith testObj\nx=1+.propget\nend with"); + CHECK_CALLED(testobj_propget_d); + CHECK_CALLED(testobj_propget_i); + + SET_EXPECT(testobj_propput_d); + SET_EXPECT(testobj_propput_i); + parse_script_a("with testObj\n.propput = 1\nend with"); + CHECK_CALLED(testobj_propput_d); + CHECK_CALLED(testobj_propput_i); + parse_htmlscript_a(""); parse_htmlscript_a("\n");