Skip to content

Commit

Permalink
Correct unit test
Browse files Browse the repository at this point in the history
Signed-off-by: anushkamittal2001 <anushka@nirmata.com>
  • Loading branch information
anushkamittal2001 committed Sep 28, 2023
1 parent e600bea commit 7e7a683
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pkg/controllers/webhook/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

func TestGetMinimumOperations(t *testing.T) {
// Define a test case with an input map and expected result
testCases := []struct {
name string
inputMap map[string]bool
Expand Down Expand Up @@ -39,15 +38,8 @@ func TestGetMinimumOperations(t *testing.T) {
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
result := getMinimumOperations(testCase.inputMap)
if len(result) != len(testCase.expectedResult) {
if !reflect.DeepEqual(result, testCase.expectedResult) {
t.Errorf("Expected %v, but got %v", testCase.expectedResult, result)
return
}
for i := range result {
if string(result[i]) != testCase.expectedResult[i] {
t.Errorf("Expected %v, but got %v", testCase.expectedResult, result)
return
}
}
})
}
Expand Down

0 comments on commit 7e7a683

Please sign in to comment.