From 50b12d7f95a8a78667011310116cb743e06a5aaa Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Sun, 2 Apr 2023 20:06:14 -0400 Subject: [PATCH] make test_basic version agnostic --- termbox2.h | 2 +- tests/test_basic/expected.ansi | 2 +- tests/test_basic/test.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/termbox2.h b/termbox2.h index 0d61812..584cf91 100644 --- a/termbox2.h +++ b/termbox2.h @@ -58,7 +58,7 @@ extern "C" { // __ffi_start -#define TB_VERSION_STR "2.1.0-dev" +#define TB_VERSION_STR "2.2.0-dev" #if defined(TB_LIB_OPTS) || 0 // __tb_lib_opts // Ensure consistent compile-time options when using as a library diff --git a/tests/test_basic/expected.ansi b/tests/test_basic/expected.ansi index 5b4dca1..08f930a 100644 --- a/tests/test_basic/expected.ansi +++ b/tests/test_basic/expected.ansi @@ -1,4 +1,4 @@ -#5version=2.1.0-dev +#5has_version=y #5width=80 #5height=24 #5attr=TB_BOLD diff --git a/tests/test_basic/test.php b/tests/test_basic/test.php index 9ecb93f..0c6eb30 100755 --- a/tests/test_basic/test.php +++ b/tests/test_basic/test.php @@ -12,7 +12,9 @@ $green = $test->defines['TB_GREEN']; $blue = $test->defines['TB_BLUE']; $y = 0; -$test->ffi->tb_printf(0, $y++, 0, 0, "version=%s", $test->ffi->tb_version()); +$version_str = $test->ffi->tb_version(); +$has_version = is_string($version_str) && strlen($version_str) > 0; +$test->ffi->tb_printf(0, $y++, 0, 0, "has_version=%s", $has_version ? 'y' : 'n'); $test->ffi->tb_printf(0, $y++, $red, $bg, "width=%d", $w); $test->ffi->tb_printf(0, $y++, $green, $bg, "height=%d", $h); foreach (['TB_BOLD', 'TB_UNDERLINE', 'TB_ITALIC', 'TB_REVERSE'] as $attr) { -- 2.39.5