Add string length constant folding test

This commit is contained in:
bmcq-0 2021-11-05 15:41:44 -04:00
parent d35c4e7b7d
commit 67b9e834fa
No known key found for this signature in database
GPG key ID: 8C6B034E7B3AE18B

View file

@ -1168,6 +1168,17 @@ RETURN R0 1
)");
}
TEST_CASE("ConstantFoldStringLen")
{
CHECK_EQ("\n" + compileFunction0("return #'string', #'', #'a', #('b')"), R"(
LOADN R0 6
LOADN R1 0
LOADN R2 1
LOADN R3 1
RETURN R0 4
)");
}
TEST_CASE("ConstantFoldCompare")
{
// ordered comparisons