You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is really tough to minimize, but occasionally the C# target will throw an error that is a wrapped version of the one I expect. Specifically, it looks like this wrapper is used.
I've boiled the behavior down to a test case, which I'll link shortly.
The text was updated successfully, but these errors were encountered:
Well, this turns out to be difficult to reproduce. I can't get it to fail using the Haxe test runner, only the old unit test version. Here's a standalone repro:
-mainRunTests.hx
-cp src
-cp tests
-cp ../hx3compat/std/ # link to the old hx3compat test runner.
-cmd mono bin/test/bin/RunTests.exe
-cs bin/test
package ;
importhaxe.unit.*;
classRunTests {
staticfunctionmain() {
varr=newTestRunner();
r.add(newWrappedError());
trace(r.run() ?0:500);
}
}
classWrappedErrorextendshaxe.unit.TestCase {
publicfunctiontestWrappedError(){
varapi=newTestApi();
try{
Runner.run(api);
trace("the above should throw an error");
assertTrue(false);
} catch (e:Error) {
trace(e+" is the value for e");
varres=switch(e){
caseExpected : true;
default : false;
}
assertTrue(res);
trace("The catch block should have caught an expected error type, instead we got:\n"+e);
assertTrue(false);
}
}
}
classTestApiextendsApi<Dynamic> {
// Suspicious : If I remove this dummy function, the test passespublicfunctiondummy() { }
// Suspicious : If I remove this override, the test passesoverridepublicfunctionexec( params:Dynamic) :String {
throwExpected;
return'hi';
}
}
// Suspicious : If I drop this irrelevant Dynamic parameter, the test passes.classApi<Dynamic> {
publicfunctionnew(){ }
publicfunctionexec( params:Dynamic) :String {
throwExpected;
return'hi';
}
}
classRunner{
publicstaticfunctionrun( api:Api<Dynamic>) {
api.exec(null);
}
}
enumError {
Expected;
}
This is really tough to minimize, but occasionally the C# target will throw an error that is a wrapped version of the one I expect. Specifically, it looks like this wrapper is used.
I've boiled the behavior down to a test case, which I'll link shortly.
The text was updated successfully, but these errors were encountered: