mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 10:36:24 +05:00
Updated tests for GreaterThan
This commit is contained in:
committed by
Dan Christian Bogos
parent
a1541de38c
commit
896362f32e
@@ -142,8 +142,10 @@ func TestReflectAsMapStringIface(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGreaterThan(t *testing.T) {
|
||||
if _, err := GreaterThan(1, 1.2, false); err == nil || err.Error() != "incomparable" {
|
||||
if gte, err := GreaterThan(1, 1.2, false); err != nil {
|
||||
t.Error(err)
|
||||
} else if gte {
|
||||
t.Error("should be not greater than")
|
||||
}
|
||||
if _, err := GreaterThan(struct{}{},
|
||||
map[string]interface{}{"a": "a"}, false); err == nil || err.Error() != "incomparable" {
|
||||
|
||||
@@ -490,8 +490,8 @@ func TestRSRFilterPass(t *testing.T) {
|
||||
if fltr.Pass("0s") {
|
||||
t.Error("passing!")
|
||||
}
|
||||
if fltr.Pass("13") {
|
||||
t.Error("passing!")
|
||||
if !fltr.Pass("13") {
|
||||
t.Error("not passing!")
|
||||
}
|
||||
if !fltr.Pass("12s") {
|
||||
t.Error("not passing!")
|
||||
@@ -523,8 +523,8 @@ func TestRSRFilterPass(t *testing.T) {
|
||||
if !fltr.Pass("0s") {
|
||||
t.Error("not passing!")
|
||||
}
|
||||
if fltr.Pass("13") {
|
||||
t.Error("passing!")
|
||||
if !fltr.Pass("13") {
|
||||
t.Error("not passing!")
|
||||
}
|
||||
if !fltr.Pass("12s") {
|
||||
t.Error("not passing!")
|
||||
@@ -574,8 +574,8 @@ func TestRSRFilterPass(t *testing.T) {
|
||||
if !fltr.Pass("1ns") {
|
||||
t.Error("not passing!")
|
||||
}
|
||||
if fltr.Pass("13") {
|
||||
t.Error("passing!")
|
||||
if !fltr.Pass("13") {
|
||||
t.Error("not passing!")
|
||||
}
|
||||
if !fltr.Pass("12s") {
|
||||
t.Error("not passing!")
|
||||
@@ -613,8 +613,8 @@ func TestRSRFilterPass(t *testing.T) {
|
||||
if fltr.Pass("0s") {
|
||||
t.Error("passing!")
|
||||
}
|
||||
if fltr.Pass("13") {
|
||||
t.Error("passing!")
|
||||
if !fltr.Pass("13") {
|
||||
t.Error("not passing!")
|
||||
}
|
||||
if !fltr.Pass("12s") {
|
||||
t.Error("not passing!")
|
||||
|
||||
Reference in New Issue
Block a user