From a08f73c995541a05eeed56e4e47f3de4b71dd3de Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Thu, 20 Aug 2026 16:28:54 +0800 Subject: [PATCH] test(compiler): add signed integer arithmetic operator tests - Create new test file for signed integer arithmetic operations - Add test cases for addition and subtraction with negative values - Verify that non-overflowing results maintain integer type - Test increment and decrement operations with integer preservation - Include expected output for all arithmetic operations - Validate type checking behavior with requireInt function calls --- .../operator/signed-integer-arithmetic.phpt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/compiler/operator/signed-integer-arithmetic.phpt diff --git a/tests/compiler/operator/signed-integer-arithmetic.phpt b/tests/compiler/operator/signed-integer-arithmetic.phpt new file mode 100644 index 00000000..bfad1136 --- /dev/null +++ b/tests/compiler/operator/signed-integer-arithmetic.phpt @@ -0,0 +1,32 @@ +--TEST-- +signed integer arithmetic keeps non-overflowing results as integers +--FILE-- + +--EXPECT-- +int(0) +int(-1) +int(0) +int(-1)