aboutsummaryrefslogtreecommitdiff
path: root/internal/test/helpers.go
blob: 4cfca1eea8fd51bcaba70537a58c19a487d5030c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*******************************************************************************
* Copyright 2025 Stefan Majewsky <majewsky@gmx.net>
* SPDX-License-Identifier: Apache-2.0
* Refer to the file "LICENSE" for details.
*******************************************************************************/

package test

import (
	"reflect"
	"testing"
)

func AssertEqual[V any](t *testing.T, actual, expected V) bool {
	if reflect.DeepEqual(actual, expected) {
		return true
	}
	t.Helper()
	t.Errorf("expected %#v, but got %#v", expected, actual)
	return false
}