Hi Gabriel,
On 05.02.2020 17:38, Gabriel Ivăncescu wrote:
- SET_EXPECT(OnEnterScript);
- SET_EXPECT(OnLeaveScript);
- hres = IActiveScriptParse_ParseScriptText(parse, L"testSub_global\n", L"code context", NULL, NULL, 0, 0, 0, NULL, NULL);
- ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
- CHECK_CALLED(OnEnterScript);
- CHECK_CALLED(OnLeaveScript);
- SET_EXPECT(OnScriptError);
- SET_EXPECT(OnEnterScript);
- SET_EXPECT(OnLeaveScript);
- hres = IActiveScriptParse_ParseScriptText(parse, L"testSub_global = 10\n", L"code context", NULL, NULL, 0, 0, 0, NULL, NULL);
- ok(FAILED(hres), "ParseScriptText returned: %08x\n", hres);
- CHECK_CALLED(OnScriptError);
- CHECK_CALLED(OnEnterScript);
- CHECK_CALLED(OnLeaveScript);
A few more similar tests would be nice. For example, a test confirming that a script ran with "code context" can call testSub, a test that code ran in global can't call testSub. Maybe a similar test with variables instead of functions (both implicit and explicit), maybe even classes. Testing 'me' expression would also be nice: something along lines of ok(me is visibleItem, ....). You touch a lot of places in interpreter and most of those changes could have at least a very simple test.
Thanks,
Jacek