summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-03-08 01:17:11 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-03-08 01:17:11 +0000
commit421ae75fa94a05b71c03255af4ad597a60fc8ed9 (patch)
tree6aa4e817a2ad4ecbcaeb770d86acdbc594204bdc /test
parentLoad terrain deform fixture data from JSON (diff)
downloadilt-421ae75fa94a05b71c03255af4ad597a60fc8ed9.tar.bz2
ilt-421ae75fa94a05b71c03255af4ad597a60fc8ed9.tar.xz
ilt-421ae75fa94a05b71c03255af4ad597a60fc8ed9.zip
Rework stream support to work with any collection
Diffstat (limited to 'test')
-rw-r--r--test/test-static-stream_support.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/test/test-static-stream_support.cpp b/test/test-static-stream_support.cpp
index 3002ccc..6bf9ea4 100644
--- a/test/test-static-stream_support.cpp
+++ b/test/test-static-stream_support.cpp
@@ -1,11 +1,20 @@
#include "stream_support.h"
#include <array>
+#include <map>
+#include <set>
#include <vector>
-static_assert(spanable<std::vector<int>>);
-static_assert(spanable<std::vector<char>>);
-static_assert(spanable<std::array<int, 1>>);
-static_assert(spanable<std::array<char, 1>>);
-static_assert(!spanable<std::string>);
-static_assert(!spanable<std::string_view>);
+static_assert(NonStringIterableCollection<std::vector<int>>);
+static_assert(NonStringIterableCollection<std::set<int>>);
+static_assert(NonStringIterableCollection<std::map<int, int>>);
+static_assert(NonStringIterableCollection<std::vector<char>>);
+static_assert(NonStringIterableCollection<std::array<int, 1>>);
+static_assert(NonStringIterableCollection<std::array<char, 1>>);
+static_assert(!NonStringIterableCollection<std::string>);
+static_assert(!NonStringIterableCollection<std::string_view>);
+
+static_assert(requires(std::vector<int> i, std::ostream & o) { o << i; });
+static_assert(requires(std::array<int, 10> i, std::ostream & o) { o << i; });
+static_assert(requires(std::set<int> i, std::ostream & o) { o << i; });
+static_assert(requires(std::map<int, int> i, std::ostream & o) { o << i; });