From 16badbbbdcd4f825a02059c568938c5fe6144696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Wed, 15 Nov 2023 10:44:20 +0200 Subject: [PATCH] Add unit test for pos/neg zero --- tests/Compiler.test.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Compiler.test.cpp b/tests/Compiler.test.cpp index a594ce90..76fe0207 100644 --- a/tests/Compiler.test.cpp +++ b/tests/Compiler.test.cpp @@ -4501,6 +4501,12 @@ GETIMPORT R0 1 [print] LOADK R1 K2 [1, 2, 3, 4] CALL R0 1 0 RETURN R0 0 +)"); + + CHECK_EQ("\n" + compileFunction("return Vector3.new(0, 0, 0), Vector3.new(-0, 0, 0)", 0, 2, /*enableVectors*/ true), R"( +LOADK R0 K0 [0, 0, 0] +LOADK R1 K1 [-0, 0, 0] +RETURN R0 2 )"); }