-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconflict_test.go
More file actions
47 lines (43 loc) · 1.12 KB
/
Copy pathconflict_test.go
File metadata and controls
47 lines (43 loc) · 1.12 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package idemkit
import "testing"
func TestConflictMode_String(t *testing.T) {
cases := []struct {
mode ConflictMode
want string
}{
{ConflictStripe, "stripe"},
{ConflictIETF, "ietf"},
{ConflictMode(99), "ConflictMode(99)"},
{ConflictMode(-1), "ConflictMode(-1)"},
}
for _, c := range cases {
t.Run(c.want, func(t *testing.T) {
if got := c.mode.String(); got != c.want {
t.Fatalf("ConflictMode(%d).String() = %q, want %q", c.mode, got, c.want)
}
})
}
}
func TestConflictMode_StripeIsZeroValue(t *testing.T) {
var zero ConflictMode
if zero != ConflictStripe {
t.Fatalf("zero-value ConflictMode = %v, want ConflictStripe (default per plan)", zero)
}
}
func TestConflictReason_String(t *testing.T) {
cases := []struct {
reason ConflictReason
want string
}{
{ReasonBodyMismatch, "body_mismatch"},
{ConflictReason(99), "ConflictReason(99)"},
{ConflictReason(-1), "ConflictReason(-1)"},
}
for _, c := range cases {
t.Run(c.want, func(t *testing.T) {
if got := c.reason.String(); got != c.want {
t.Fatalf("ConflictReason(%d).String() = %q, want %q", c.reason, got, c.want)
}
})
}
}