commit 55ecf249fc27a30704604661c55355ebb2d0e4b8
Author: Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Fri Apr 7 18:28:59 2023 -0600
Commit: Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Fri Apr 7 18:28:59 2023 -0600
Update z8lua with split() fix
Empty args should return nothing
---
libs/z8lua | 2 +-
test/carts/screenshots/split_noargs_test_f01.png | Bin 0 -> 352 bytes
test/carts/split_noargs_test.p8 | 15 +++++++++++++++
test/endtoendtests.cpp | 14 ++++++++++++++
4 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/libs/z8lua b/libs/z8lua
index 3a3a47b..b6eda59 160000
--- a/libs/z8lua
+++ b/libs/z8lua
@@ -1 +1 @@
-Subproject commit 3a3a47b437715840535af15abb5419a297ab289d
+Subproject commit b6eda597972f05ab75d87af1aefbdc940f28314a
diff --git a/test/carts/screenshots/split_noargs_test_f01.png b/test/carts/screenshots/split_noargs_test_f01.png
new file mode 100644
index 0000000..1d6dd0e
Binary files /dev/null and b/test/carts/screenshots/split_noargs_test_f01.png differ
diff --git a/test/carts/split_noargs_test.p8 b/test/carts/split_noargs_test.p8
new file mode 100644
index 0000000..1cf7454
--- /dev/null
+++ b/test/carts/split_noargs_test.p8
@@ -0,0 +1,15 @@
+pico-8 cartridge // http://www.pico-8.com
+version 41
+__lua__
+function _draw()
+ cls(3)
+ emptysplit=split()
+ print(emptysplit)
+end
+__gfx__
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/test/endtoendtests.cpp b/test/endtoendtests.cpp
index 62fb144..60663c2 100644
--- a/test/endtoendtests.cpp
+++ b/test/endtoendtests.cpp
@@ -720,6 +720,20 @@ TEST_CASE("Loading and running carts") {
vm->CloseCart();
}
+ SUBCASE("split with no args test"){
+ vm->LoadCart("split_noargs_test.p8", false);
+
+ SUBCASE("No error reported"){
+ CHECK(vm->GetBiosError() == "");
+ }
+ SUBCASE("sceen matches screenshot"){
+ vm->UpdateAndDraw();
+
+ CHECK(verifyScreenshot(vm, host, "carts/screenshots/split_noargs_test_f01.png"));
+ }
+
+ vm->CloseCart();
+ }
delete vm;