make tests slightly easier to write
This commit is contained in:
+7
-7
@@ -15,18 +15,18 @@ func TestReadParams(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
t.Log("Input:", testCase.Input)
|
||||
t.Log("Expected output:", testCase.Output)
|
||||
for _, tc := range testCases {
|
||||
t.Log("Input:", tc.Input)
|
||||
t.Log("Expected output:", tc.Output)
|
||||
|
||||
params := ReadParams(testCase.Input)
|
||||
params := ReadParams(tc.Input)
|
||||
|
||||
if len(params) != len(testCase.Output) {
|
||||
t.Errorf("Expected %d parameters", len(testCase.Output))
|
||||
if len(params) != len(tc.Output) {
|
||||
t.Errorf("Expected %d parameters", len(tc.Output))
|
||||
break
|
||||
}
|
||||
|
||||
for i, name := range testCase.Output {
|
||||
for i, name := range tc.Output {
|
||||
if params[i] != name {
|
||||
t.Errorf("Expected parameter %d to be %q", i, name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user