Skip to content

Commit a94f999

Browse files
author
James Cor
committed
fixing tests
1 parent 493e957 commit a94f999

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sql/expression/function/logarithm_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func TestLog2(t *testing.T) {
8282
{"Input value is zero", types.Float64, sql.NewRow(0), nil, nil},
8383
{"Input value is negative", types.Float64, sql.NewRow(-1), nil, nil},
8484
{"Input value is valid string", types.Float64, sql.NewRow("2"), float64(1), nil},
85-
{"Input value is invalid string", types.Float64, sql.NewRow("aaa"), nil, sql.ErrInvalidType},
85+
{"Input value is invalid string", types.Float64, sql.NewRow("aaa"), nil, nil},
8686
{"Input value is invalid string truncates", types.Float64, sql.NewRow("123.456"), 6.947853143387016, nil},
8787
{"Input value is valid float64", types.Float64, sql.NewRow(3), 1.5849625007211563, nil},
8888
{"Input value is valid float32", types.Float32, sql.NewRow(float32(6)), 2.584962500721156, nil},
@@ -123,7 +123,7 @@ func TestLog10(t *testing.T) {
123123
{"Input value is zero", types.Float64, sql.NewRow(0), nil, nil},
124124
{"Input value is negative", types.Float64, sql.NewRow(-1), nil, nil},
125125
{"Input value is valid string", types.Float64, sql.NewRow("2"), float64(0.3010299956639812), nil},
126-
{"Input value is invalid string", types.Float64, sql.NewRow("aaa"), nil, sql.ErrInvalidType},
126+
{"Input value is invalid string", types.Float64, sql.NewRow("aaa"), nil, nil},
127127
{"Input value is invalid string truncates", types.Float64, sql.NewRow("123.456"), 2.0915122016277716, nil},
128128
{"Input value is valid float64", types.Float64, sql.NewRow(3), 0.4771212547196624, nil},
129129
{"Input value is valid float32", types.Float32, sql.NewRow(float32(6)), 0.7781512503836436, nil},

sql/expression/function/sqrt_power_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ func TestSqrt(t *testing.T) {
3838
{"null input", sql.NewRow(nil), nil, false},
3939
{"invalid string", sql.NewRow("foo"), 0.0, false},
4040
{"invalid string truncated", sql.NewRow("123foo"), 11.090536506409418, false},
41-
{"valid string", sql.NewRow("9"), 3, false},
42-
{"number is zero", sql.NewRow(0), 0, false},
41+
{"valid string", sql.NewRow("9"), 3.0, false},
42+
{"number is zero", sql.NewRow(0), 0.0, false},
4343
{"positive number", sql.NewRow(8), 2.8284271247461903, false},
4444
{"negative number", sql.NewRow(-1), nil, false},
4545
}

0 commit comments

Comments
 (0)