From 08ea24952ece9c82a932910126975d26e486758c Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 8 Nov 2024 18:02:09 +0100 Subject: Test that empty optional does not exist --- optional/main_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 optional/main_test.go diff --git a/optional/main_test.go b/optional/main_test.go new file mode 100644 index 0000000..2beb52a --- /dev/null +++ b/optional/main_test.go @@ -0,0 +1,15 @@ +package optional_test + +import ( + "testing" + + "xengineering.eu/optional-go/optional" +) + +func TestDefault(t *testing.T) { + var o optional.Optional[bool] + + if o.Exists { + t.Fatal("Empty optional claims to exist.") + } +} -- cgit v1.2.3-70-g09d2