aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/tick_values_test.go
blob: 4c704bb7576457e434568c7cc69c36c98d921785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package engine

import "testing"

// TestValuesEqualUncomparableDoesNotPanic: a YAML list/map flag value must not
// panic a tick system when compared (== panics on uncomparable dynamic types).
func TestValuesEqualUncomparableDoesNotPanic(t *testing.T) {
	if !ValuesEqual([]any{1, 2}, []any{1, 2}) {
		t.Fatal("equal slices should compare equal")
	}
	if ValuesEqual([]any{1, 2}, []any{1, 3}) {
		t.Fatal("different slices should not compare equal")
	}
	if !ValuesEqual(map[string]any{"x": 1}, map[string]any{"x": 1}) {
		t.Fatal("equal maps should compare equal")
	}
	if ValuesEqual(map[string]any{"x": 1}, map[string]any{"x": 2}) {
		t.Fatal("different maps should not compare equal")
	}
}