TestUnspecified.hx 516 B

1234567891011121314151617181920212223242526272829
  1. package unit;
  2. class TestUnspecified extends Test
  3. {
  4. public function testModuloZero()
  5. {
  6. #if neko
  7. exc(function() 1 % 0);
  8. #elseif cpp
  9. // Crashes
  10. #elseif (php || flash9)
  11. eq(1 % 0, 0);
  12. #else
  13. t(Math.isNaN(1 % 0));
  14. #end
  15. }
  16. public function testMonoAdd()
  17. {
  18. var x : Array<Dynamic> = ["4", 1];
  19. #if (php || flash9)
  20. t(Std.is(x[0] + x[0], Int));
  21. t(Std.is(x[0] + x[1], Int));
  22. #else
  23. t(Std.is(x[0] + x[0], String));
  24. t(Std.is(x[0] + x[1], String));
  25. #end
  26. }
  27. }