Skip to content

Commit

Permalink
Rename testcase name
Browse files Browse the repository at this point in the history
  • Loading branch information
lixingwang committed Oct 23, 2018
1 parent 841fc81 commit 28991b6
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions core/mapper/exprmapper/expression/expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ func TestExpressionWithNegtiveNumber(t *testing.T) {
assert.Equal(t, true, v)
}

func Test_Eval(t *testing.T) {
func TestFloatWithInt(t *testing.T) {
expr, _ := ParseExpression("1 == 1.23")
fmt.Println(fmt.Sprintf("%+v", expr))
i, err := expr.Eval()
Expand All @@ -815,39 +815,33 @@ func Test_Eval(t *testing.T) {
if res {
t.Errorf("Expected false, got : %t\n ", res)
}
}

func Test_Eval2(t *testing.T) {
expr, _ := ParseExpression("1 < 1.23")
i, err := expr.Eval()
expr, _ = ParseExpression("1 < 1.23")
i, err = expr.Eval()
if err != nil {
t.Fatalf("error %s\n", err)
}
res := i.(bool)
res = i.(bool)
if !res {
t.Errorf("Expected true, got : %t\n ", res)
}
}

func Test_Eval3(t *testing.T) {
expr, _ := ParseExpression("1.23 == 1")
i, err := expr.Eval()
expr, _ = ParseExpression("1.23 == 1")
i, err = expr.Eval()
if err != nil {
t.Fatalf("error %s\n", err)
}
res := i.(bool)
res = i.(bool)
if res {
t.Errorf("Expected false, got : %t\n ", res)
}
}

func Test_Eval4(t *testing.T) {
expr, _ := ParseExpression("1.23 > 1")
i, err := expr.Eval()
expr, _ = ParseExpression("1.23 > 1")
i, err = expr.Eval()
if err != nil {
t.Fatalf("error %s\n", err)
}
res := i.(bool)
res = i.(bool)
if !res {
t.Errorf("Expected true, got : %t\n ", res)
}
Expand Down

0 comments on commit 28991b6

Please sign in to comment.