commit 6faf70b667bf7d8b780f76790676e51b28fe525b
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Sat Sep 26 20:29:51 2020 -0600
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Sat Sep 26 20:29:51 2020 -0600
add shorthand print tests
---
test/cartpatchertests.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/test/cartpatchertests.cpp b/test/cartpatchertests.cpp
index 3ffd5f5..82287ab 100644
--- a/test/cartpatchertests.cpp
+++ b/test/cartpatchertests.cpp
@@ -52,5 +52,14 @@ TEST_CASE("Cart Patcher/Preprocessor tests") {
CHECK(patched == "x=0 while (x<5) do print(x) x = x + 1 end\n");
}
+ SUBCASE("shorthand print statement converted"){
+ std::string patched = getPatchedLua("?x\n");
+ CHECK(patched == "print(x)\n");
+ }
+ SUBCASE("shorthand print statement with args converted"){
+ std::string patched = getPatchedLua("?thing, 65, 32,c\n");
+
+ CHECK(patched == "print(thing, 65, 32,c)\n");
+ }
}