foxygit / fake-08-xbox360 Log in
commit f8d391b1139cfa0732f16941dbcd719e733fc37f
Author:     Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Tue Apr 19 18:42:33 2022 -0600
Commit:     Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Tue Apr 19 18:42:33 2022 -0600

    add failing shorthand print end to end test
---
 test/carts/screenshots/short_print_test_f01.png | Bin 0 -> 858 bytes
 test/carts/short_print_test.p8                  |  27 ++++++++++++++++++++++++
 test/endtoendtests.cpp                          |  14 ++++++++++++
 3 files changed, 41 insertions(+)

diff --git a/test/carts/screenshots/short_print_test_f01.png b/test/carts/screenshots/short_print_test_f01.png
new file mode 100644
index 0000000..d70efb1
Binary files /dev/null and b/test/carts/screenshots/short_print_test_f01.png differ
diff --git a/test/carts/short_print_test.p8 b/test/carts/short_print_test.p8
new file mode 100644
index 0000000..2d4d217
--- /dev/null
+++ b/test/carts/short_print_test.p8
@@ -0,0 +1,27 @@
+pico-8 cartridge // http://www.pico-8.com
+version 35
+__lua__
+function _draw()
+ cls()
+ ?"print shorthand start of line"
+ local strvar = "string var"
+ ?strvar
+ ?strvar.." at location",30,30
+
+ if(strvar) ?strvar.." again after if"
+
+ result = dummy() and ?strvar
+
+ result = not dummy() or ?strvar
+end
+
+function dummy()
+ return true
+end
+__gfx__
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/test/endtoendtests.cpp b/test/endtoendtests.cpp
index 0056acd..ee370b1 100644
--- a/test/endtoendtests.cpp
+++ b/test/endtoendtests.cpp
@@ -581,6 +581,20 @@ TEST_CASE("Loading and running carts") {

         vm->CloseCart();
     }
+    SUBCASE("shorthand print (?) test"){
+        vm->LoadCart("short_print_test.p8");
+
+        SUBCASE("No error reported"){
+            CHECK(vm->GetBiosError() == "");
+        }
+        SUBCASE("sceen matches screenshot"){
+            vm->UpdateAndDraw();
+
+            CHECK(verifyScreenshot(vm, host, "carts/screenshots/short_print_test_f01.png"));
+        }
+
+        vm->CloseCart();
+    }

     delete vm;
     delete host;