aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/test/helpers.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/test/helpers.go b/internal/test/helpers.go
new file mode 100644
index 0000000..a93aa9e
--- /dev/null
+++ b/internal/test/helpers.go
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright 2025 Stefan Majewsky <majewsky@gmx.net>
+* SPDX-License-Identifier: Apache-2.0
+* Refer to the file "LICENSE" for details.
+*******************************************************************************/
+
+package option
+
+import (
+ "reflect"
+ "testing"
+)
+
+func AssertEqual[V any](t *testing.T, actual, expected V) {
+ if reflect.DeepEqual(actual, expected) {
+ return
+ }
+ t.Helper()
+ t.Errorf("expected %#v, but got %#v", expected, actual)
+}
+
+func PointerTo[V any](value V) *V {
+ return &value
+}