aboutsummaryrefslogtreecommitdiff
path: root/src/test/OptionalRefTest.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-14 18:04:03 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-14 18:04:03 +0100
commitab0b4923c4f49e7a28f6d17e994d3e013ca344bb (patch)
treeb385693017be292b8f4862e88b912dba7c6be619 /src/test/OptionalRefTest.cpp
parent213f947d0907858cace470736c15f87caa934591 (diff)
more WIP audio system + utilities
Diffstat (limited to 'src/test/OptionalRefTest.cpp')
-rw-r--r--src/test/OptionalRefTest.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/OptionalRefTest.cpp b/src/test/OptionalRefTest.cpp
new file mode 100644
index 0000000..65bd816
--- /dev/null
+++ b/src/test/OptionalRefTest.cpp
@@ -0,0 +1,16 @@
+#include <gtest/gtest.h>
+
+#include <crepe/util/OptionalRef.h>
+
+using namespace std;
+using namespace crepe;
+using namespace testing;
+
+TEST(OptionalRefTest, Explicit) {
+ string value = "foo";
+ OptionalRef<string> ref;
+
+ EXPECT_FALSE(bool(ref));
+ ASSERT_THROW(ref.get(), runtime_error);
+}
+