summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/helpers.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/helpers.h b/test/helpers.h
index 107eda5..59ae18d 100644
--- a/test/helpers.h
+++ b/test/helpers.h
@@ -4,6 +4,8 @@
#include <concepts>
#include <cstddef>
#include <ctime>
+#include <iostream>
+#include <optional>
inline constexpr std::byte operator""_b(const unsigned long long hex)
{
@@ -24,6 +26,18 @@ namespace std {
{
return to_integer<T>(b) != i;
}
+
+ template<typename T>
+ ostream &
+ operator<<(ostream & s, const std::optional<T> & o)
+ {
+ if (o) {
+ return s << *o;
+ }
+ else {
+ return s << "-";
+ }
+ }
}
inline struct tm