From 67e2191966aadc56eda52fb81658359c2e1a0c17 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Thu, 4 Jun 2026 14:31:27 +0200 Subject: [PATCH] [tests] Add reflect.compare on overflow values --- tests/unit/src/unit/teststd/TestReflect.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/src/unit/teststd/TestReflect.hx b/tests/unit/src/unit/teststd/TestReflect.hx index 522e5cf873b..3c97b19e940 100644 --- a/tests/unit/src/unit/teststd/TestReflect.hx +++ b/tests/unit/src/unit/teststd/TestReflect.hx @@ -92,6 +92,12 @@ class TestReflect extends unit.Test { eq(Reflect.compare(null,null), 0); t(Reflect.compare("abcd",null) != 0); t(Reflect.compare(null, "abcd") != 0); + var a = haxe.Int64.make(0x7FFFFFFF, 0xFFFFFFF8); // 9223372036854775800 + var b = haxe.Int64.make(0x80000000, 0x00000007); // -9223372036854775801 + t(Reflect.compare(a, b) > 0); + var a = 2147483640; + var b = -2147483641; + t(Reflect.compare(a, b) > 0); // compareMethods var x = function(t) return 1;