Update test for go 1.10 and update travis to run on go 1.10

This commit is contained in:
TeoV
2018-02-19 07:04:28 -05:00
committed by Dan Christian Bogos
parent 3e15ab12ef
commit 6f4a0025dd
12 changed files with 30 additions and 30 deletions

View File

@@ -69,18 +69,18 @@ func TestCGRReplyGetFieldAsString(t *testing.T) {
if strVal, err := cgrRply.GetFieldAsString("*cgrReply>Error", ">"); err != nil {
t.Error(err)
} else if strVal != "" {
t.Error("received: <%s>", strVal)
t.Errorf("received: <%s>", strVal)
}
eVal := "Val1"
if strVal, err := cgrRply.GetFieldAsString("*cgrReply>FirstLevel>SecondLevel>ThirdLevel>Fld1", ">"); err != nil {
t.Error(err)
} else if strVal != eVal {
t.Error("expecting: <%s> received: <%s>", eVal, strVal)
t.Errorf("expecting: <%s> received: <%s>", eVal, strVal)
}
eVal = "ValAnotherFirstLevel"
if strVal, err := cgrRply.GetFieldAsString("*cgrReply>AnotherFirstLevel", ">"); err != nil {
t.Error(err)
} else if strVal != eVal {
t.Error("expecting: <%s> received: <%s>", eVal, strVal)
t.Errorf("expecting: <%s> received: <%s>", eVal, strVal)
}
}

View File

@@ -66,7 +66,7 @@ func TestNewDerivedCharger(t *testing.T) {
}
if dc1, err := NewDerivedCharger("test1", "", "reqtype1", "direction1", "tenant1", "tor1", "account1", "subject1", "destination1",
"setuptime1", "pdd1", "answertime1", "duration1", "supplier1", "NORMAL_CLEARING", "rated1", "cost1"); err != nil {
t.Error("Unexpected error", err.Error)
t.Error("Unexpected error", err.Error())
} else if !reflect.DeepEqual(edc1, dc1) {
t.Errorf("Expecting: %v, received: %v", edc1, dc1)
}

View File

@@ -34,42 +34,42 @@ func TestReflectFieldAsStringOnStruct(t *testing.T) {
if strVal, err := ReflectFieldAsString(mystruct, "Title", "ExtraFields"); err != nil {
t.Error(err)
} else if strVal != "Title1" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(mystruct, "Count", "ExtraFields"); err != nil {
t.Error(err)
} else if strVal != "5" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(mystruct, "Count64", "ExtraFields"); err != nil {
t.Error(err)
} else if strVal != "6" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(mystruct, "Val", "ExtraFields"); err != nil {
t.Error(err)
} else if strVal != "7.3" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(mystruct, "a", "ExtraFields"); err != nil {
t.Error(err)
} else if strVal != "Title2" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(mystruct, "b", "ExtraFields"); err != nil {
t.Error(err)
} else if strVal != "15" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(mystruct, "c", "ExtraFields"); err != nil {
t.Error(err)
} else if strVal != "16" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(mystruct, "d", "ExtraFields"); err != nil {
t.Error(err)
} else if strVal != "17.3" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
}
@@ -79,42 +79,42 @@ func TestReflectFieldAsStringOnMap(t *testing.T) {
if strVal, err := ReflectFieldAsString(myMap, "Title", ""); err != nil {
t.Error(err)
} else if strVal != "Title1" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(myMap, "Count", ""); err != nil {
t.Error(err)
} else if strVal != "5" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(myMap, "Count64", ""); err != nil {
t.Error(err)
} else if strVal != "6" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(myMap, "Val", ""); err != nil {
t.Error(err)
} else if strVal != "7.3" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(myMap, "a", ""); err != nil {
t.Error(err)
} else if strVal != "Title2" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(myMap, "b", ""); err != nil {
t.Error(err)
} else if strVal != "15" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(myMap, "c", ""); err != nil {
t.Error(err)
} else if strVal != "16" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
if strVal, err := ReflectFieldAsString(myMap, "d", ""); err != nil {
t.Error(err)
} else if strVal != "17.3" {
t.Error("Received: %s", strVal)
t.Errorf("Received: %s", strVal)
}
}