From d97b02c7f2538825866dd436122ff9e1b7360548 Mon Sep 17 00:00:00 2001 From: andronache Date: Mon, 11 Oct 2021 12:13:34 +0300 Subject: [PATCH] Fixed typo in cover tests and in engine/model_helpers.go --- engine/model_helpers.go | 4 ++-- engine/model_helpers_test.go | 4 ++-- loaders/loader_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/model_helpers.go b/engine/model_helpers.go index 0b5f7d0be..c6da1f5d6 100644 --- a/engine/model_helpers.go +++ b/engine/model_helpers.go @@ -2260,7 +2260,7 @@ func (apm AccountMdls) AsTPAccount() (result []*utils.TPAccount, err error) { costIncrements := make([]*utils.TPBalanceCostIncrement, 0) sls := strings.Split(tp.BalanceCostIncrements, utils.InfieldSep) if len(sls)%4 != 0 { - return nil, fmt.Errorf("invlid key: <%s> for BalanceCostIncrements", tp.BalanceCostIncrements) + return nil, fmt.Errorf("invalid key: <%s> for BalanceCostIncrements", tp.BalanceCostIncrements) } for j := 0; j < len(sls); j = j + 4 { costIncrement, err := utils.NewTPBalanceCostIncrement(sls[j], sls[j+1], sls[j+2], sls[j+3]) @@ -2285,7 +2285,7 @@ func (apm AccountMdls) AsTPAccount() (result []*utils.TPAccount, err error) { unitFactors := make([]*utils.TPBalanceUnitFactor, 0) sls := strings.Split(tp.BalanceUnitFactors, utils.InfieldSep) if len(sls)%2 != 0 { - return nil, fmt.Errorf("invlid key: <%s> for BalanceUnitFactors", tp.BalanceUnitFactors) + return nil, fmt.Errorf("invalid key: <%s> for BalanceUnitFactors", tp.BalanceUnitFactors) } for j := 0; j < len(sls); j = j + 2 { diff --git a/engine/model_helpers_test.go b/engine/model_helpers_test.go index 33d18b013..0735c61cd 100644 --- a/engine/model_helpers_test.go +++ b/engine/model_helpers_test.go @@ -4656,7 +4656,7 @@ func TestAccountMdlsAsTPAccountError(t *testing.T) { BalanceCostIncrements: "AN;INVALID;COST;INCREMENT;VALUE", }, } - expectedErr := "invlid key: for BalanceCostIncrements" + expectedErr := "invalid key: for BalanceCostIncrements" if _, err := testStruct.AsTPAccount(); err == nil || err.Error() != expectedErr { t.Errorf("Expected %+v, received %+v", expectedErr, err) } @@ -4669,7 +4669,7 @@ func TestAccountMdlsAsTPAccountError(t *testing.T) { testStruct[0].BalanceCostIncrements = utils.EmptyString testStruct[0].BalanceUnitFactors = "NOT;A;VALUE" - expectedErr = "invlid key: for BalanceUnitFactors" + expectedErr = "invalid key: for BalanceUnitFactors" if _, err := testStruct.AsTPAccount(); err == nil || err.Error() != expectedErr { t.Errorf("Expected %+v, received %+v", expectedErr, err) } diff --git a/loaders/loader_test.go b/loaders/loader_test.go index f897be644..1f37a04a7 100644 --- a/loaders/loader_test.go +++ b/loaders/loader_test.go @@ -3203,7 +3203,7 @@ cgrates.org,1001,MonetaryBalance,fltr1&fltr2;100;fltr3 }, }, } - expectedErr := "invlid key: for BalanceUnitFactors" + expectedErr := "invalid key: for BalanceUnitFactors" if err := ldr.processContent(context.Background(), utils.MetaAccounts, utils.EmptyString); err == nil || err.Error() != expectedErr { t.Errorf("Expected %+v, received %+v", expectedErr, err) }