Coverage tests in console

This commit is contained in:
andronache
2021-02-01 16:37:24 +02:00
committed by Dan Christian Bogos
parent 4a886761bc
commit 2ce9c97d28
2 changed files with 28 additions and 9 deletions

View File

@@ -125,11 +125,13 @@ func TestCmdParseLocalExecuteCase5(t *testing.T) {
// for coverage purpose
testStruct := &CmdParse{
rpcParams: &AttrParse{
Expression: "~test_exp",
Value: "~test_value",
Expression: "~*req.Field{*duration}",
Value: "a",
},
}
testStruct.LocalExecute()
expected := "time: invalid duration \"a\""
received := testStruct.LocalExecute()
if !reflect.DeepEqual(received, expected) {
t.Errorf("Expected <%+v>, Received <%+v>", expected, received)
}
}