diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2025-01-04 15:08:53 +0100 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2025-01-04 15:08:53 +0100 |
| commit | 807a25b638e38d7c0446bb728412fb16fd035035 (patch) | |
| tree | 4cfcb99bd00857ca3296b6dbb259976dcaaae689 /internal/test | |
| download | go-gg-807a25b638e38d7c0446bb728412fb16fd035035.tar.gz | |
init
Diffstat (limited to 'internal/test')
| -rw-r--r-- | internal/test/helpers.go | 24 |
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 +} |
