From d2a6c799e2e6aaf58e04ef1304e5cef79f5b2a62 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sat, 7 Nov 2026 19:05:48 +0100 Subject: Adding proper Bool --- modules/codec/tests/data.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'modules/codec/tests/data.cpp') diff --git a/modules/codec/tests/data.cpp b/modules/codec/tests/data.cpp index a686b6d..57c56d3 100644 --- a/modules/codec/tests/data.cpp +++ b/modules/codec/tests/data.cpp @@ -10,6 +10,27 @@ using Int32Array = Array< >; } +SAW_TEST("Data Native/Bool"){ + using namespace saw; + + data t{true}; + data f; + + SAW_EXPECT(t.get(), "Should hold true"); + SAW_EXPECT(!f.get(), "Should default to false"); + + SAW_EXPECT((t != f), "Should not be equal"); + SAW_EXPECT(((t && f).get() == false), "Wrong conjunction"); + SAW_EXPECT(((t || f).get() == true), "Wrong disjunction"); + SAW_EXPECT(((!f).get() == true), "Wrong negation"); + + f.set(true); + SAW_EXPECT((t == f), "Should be equal"); + + constexpr data ct{true}; + static_assert(ct.get(), "Should be usable at compile time"); +} + SAW_TEST("Data Native/Array Access with Data Native"){ using namespace saw; -- cgit v1.3.1