commit b5455c3fda97bb7d60e0fb118912a7c99f910550
Author: Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Fri Jul 7 18:58:55 2023 -0600
Commit: Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Fri Jul 7 18:58:55 2023 -0600
Add test case for extra count arg update
---
test/carts/count_val_test.p8 | 18 ++++++++++++++++++
test/carts/screenshots/count_val_test_f01.png | Bin 0 -> 334 bytes
test/endtoendtests.cpp | 14 ++++++++++++++
3 files changed, 32 insertions(+)
diff --git a/test/carts/count_val_test.p8 b/test/carts/count_val_test.p8
new file mode 100644
index 0000000..d327e7a
--- /dev/null
+++ b/test/carts/count_val_test.p8
@@ -0,0 +1,18 @@
+pico-8 cartridge // http://www.pico-8.com
+version 41
+__lua__
+function _draw()
+ cls()
+
+ print("count val test")
+ print(count({"one","two","three"}))
+ print(count({"one","two","three"}, "ten"))
+ print(count({"one","two","three"}, "two"))
+end
+__gfx__
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/test/carts/screenshots/count_val_test_f01.png b/test/carts/screenshots/count_val_test_f01.png
new file mode 100644
index 0000000..07fe829
Binary files /dev/null and b/test/carts/screenshots/count_val_test_f01.png differ
diff --git a/test/endtoendtests.cpp b/test/endtoendtests.cpp
index f9e83c8..44009bc 100644
--- a/test/endtoendtests.cpp
+++ b/test/endtoendtests.cpp
@@ -748,6 +748,20 @@ TEST_CASE("Loading and running carts") {
vm->CloseCart();
}
+ SUBCASE("count with val arg test"){
+ vm->LoadCart("count_val_test.p8", false);
+
+ SUBCASE("No error reported"){
+ CHECK(vm->GetBiosError() == "");
+ }
+ SUBCASE("sceen matches screenshot"){
+ vm->UpdateAndDraw();
+
+ CHECK(verifyScreenshot(vm, host, "carts/screenshots/count_val_test_f01.png"));
+ }
+
+ vm->CloseCart();
+ }
delete vm;