summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-01-03 18:28:10 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-01-03 18:28:10 +0000
commitb1add835864a5907dc5a674f7eee2f3db038f704 (patch)
treec2ab5ee08422f5a9bad406e4f2b28534fb3e9cb9 /test
parentAdd transform_array (diff)
downloadilt-b1add835864a5907dc5a674f7eee2f3db038f704.tar.bz2
ilt-b1add835864a5907dc5a674f7eee2f3db038f704.tar.xz
ilt-b1add835864a5907dc5a674f7eee2f3db038f704.zip
More complete and tested stream output support
Diffstat (limited to 'test')
-rw-r--r--test/test-text.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test-text.cpp b/test/test-text.cpp
index 93a831e..6762b09 100644
--- a/test/test-text.cpp
+++ b/test/test-text.cpp
@@ -5,7 +5,11 @@
#include <boost/test/unit_test.hpp>
#include <stream_support.hpp>
+#include <array>
+#include <glm/glm.hpp>
+#include <span>
#include <ui/font.h>
+#include <vector>
struct FontTest : public Font {
FontTest() : Font {"/usr/share/fonts/corefonts/arial.ttf", 48} { }
@@ -89,3 +93,23 @@ BOOST_AUTO_TEST_CASE(render_text)
}
BOOST_AUTO_TEST_SUITE_END()
+
+BOOST_AUTO_TEST_CASE(stream_vec)
+{
+ BOOST_CHECK_EQUAL(streamed_string(glm::vec3 {1.2, 2.3, 3.4}), "(1.2, 2.3, 3.4)");
+}
+
+BOOST_AUTO_TEST_CASE(stream_array)
+{
+ BOOST_CHECK_EQUAL(streamed_string(std::array {1.2, 2.3, 3.4}), "(1.2, 2.3, 3.4)");
+}
+
+BOOST_AUTO_TEST_CASE(stream_vector)
+{
+ BOOST_CHECK_EQUAL(streamed_string(std::vector {1.2, 2.3, 3.4}), "(1.2, 2.3, 3.4)");
+}
+
+BOOST_AUTO_TEST_CASE(stream_mat)
+{
+ BOOST_CHECK_EQUAL(streamed_string(glm::mat2 {1.2, 2.3, 3.4, 4.5}), "((1.2, 2.3), (3.4, 4.5))");
+}