Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
danroc committed Nov 1, 2024
1 parent 3f66cfe commit 7283947
Showing 1 changed file with 54 additions and 9 deletions.
63 changes: 54 additions & 9 deletions pkg/utils/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ func TestAny(t *testing.T) {
}{
{"empty slice", []int{}, func(v int) bool { return v > 0 }, false},
{"no match", []int{1, 2, 3}, func(v int) bool { return v > 3 }, false},
{"one match", []int{1, 2, 3}, func(v int) bool { return v == 2 }, true},
{
"one match",
[]int{1, 2, 3},
func(v int) bool { return v == 2 },
true,
},
{"all match", []int{1, 2, 3}, func(v int) bool { return v > 0 }, true},
}

Expand All @@ -35,10 +40,30 @@ func TestAll(t *testing.T) {
f func(int) bool
want bool
}{
{"empty slice", []int{}, func(v int) bool { return v > 0 }, true},
{"no match", []int{1, 2, 3}, func(v int) bool { return v > 3 }, false},
{"one match", []int{1, 2, 3}, func(v int) bool { return v == 2 }, false},
{"all match", []int{1, 2, 3}, func(v int) bool { return v > 0 }, true},
{
"empty slice",
[]int{},
func(v int) bool { return v > 0 },
true,
},
{
"no match",
[]int{1, 2, 3},
func(v int) bool { return v > 3 },
false,
},
{
"one match",
[]int{1, 2, 3},
func(v int) bool { return v == 2 },
false,
},
{
"all match",
[]int{1, 2, 3},
func(v int) bool { return v > 0 },
true,
},
}

for _, tt := range tests {
Expand All @@ -57,10 +82,30 @@ func TestNone(t *testing.T) {
f func(int) bool
want bool
}{
{"empty slice", []int{}, func(v int) bool { return v > 0 }, true},
{"no match", []int{1, 2, 3}, func(v int) bool { return v > 3 }, true},
{"one match", []int{1, 2, 3}, func(v int) bool { return v == 2 }, false},
{"all match", []int{1, 2, 3}, func(v int) bool { return v > 0 }, false},
{
"empty slice",
[]int{},
func(v int) bool { return v > 0 },
true,
},
{
"no match",
[]int{1, 2, 3},
func(v int) bool { return v > 3 },
true,
},
{
"one match",
[]int{1, 2, 3},
func(v int) bool { return v == 2 },
false,
},
{
"all match",
[]int{1, 2, 3},
func(v int) bool { return v > 0 },
false,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 7283947

Please sign in to comment.