aboutsummaryrefslogtreecommitdiff
path: root/internal/assert/assert.go
blob: c4e7b506eba54ed5190f62aabbb780a01fe17824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-FileCopyrightText: 2026 Stefan Majewsky <majewsky@gmx.net>
// SPDX-License-Identifier: Apache-2.0

package assert

import (
	"reflect"
	"testing"
)

// Equal is a test assertion.
func Equal[V comparable](t *testing.T, actual, expected V) {
	t.Helper()
	if actual != expected {
		t.Errorf("expected %#v, but got %#v", expected, actual)
	}
}

// DeepEqual is a test assertion.
func DeepEqual[V any](t *testing.T, actual, expected V) {
	t.Helper()
	if !reflect.DeepEqual(actual, expected) {
		t.Errorf("expected %#v, but got %#v", expected, actual)
	}
}