haxe
haxe copied to clipboard
[tests] Add more Null op tests
When I made the HL implementation for null ops, I found that we can have some more spec tests
- when doing
</>/<=/>=betweennullvalues: it does not really make sens but I think it's good to ensure the same behavior - between
null : Null<Int>and0 : Null<Int>: it's different thanNull<Int>withInt, at least the code generated by HL is different
It seems work as expected on HL, let's see if tests pass for other target.
In summary:
Cpp fail because when comparing null <= null, it convert the value to 0 first (I don't think it's really a problem by itself).
Php fail because I added analyzer(ignore) on testOps. Probably the assign does not worked:
var k = false;
f((k = true) ? false : true);
t(k);
Lua: I can't understand the error 😢
Could you update this branch? I'd like to see the exact cpp error.
After talking with @yuxiaomao we agreed that C++ is actually correct here because we basically test null >= null and that should be true, not false. That means that both the HL and JVM implementations need a fix.