Skip to content

Commit 22341a1

Browse files
committed
add: Test case for floats equal 0.0
Signed-off-by: idiaz <[email protected]>
1 parent 7aeac3a commit 22341a1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

driver/resthandler_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ func TestNewCommandValue(t *testing.T) {
8282
{"Test A Bool error", "bad", nil, common.ValueTypeBool, "", "text/plain", true},
8383
{"Test A Float32+", "123.456", float32(123.456), common.ValueTypeFloat32, "", "text/plain", false},
8484
{"Test A Float32-", "-123.456", float32(-123.456), common.ValueTypeFloat32, "", "text/plain", false},
85+
{"Test A Float32 0.0", "0.0", float32(0.0), common.ValueTypeFloat32, "", "text/plain", false},
8586
{"Test A Float32 error", "-123.junk", nil, common.ValueTypeFloat32, "", "text/plain", true},
8687
{"Test A Float64+", "456.123", 456.123, common.ValueTypeFloat64, "", "text/plain", false},
8788
{"Test A Float64-", "-456.123", -456.123, common.ValueTypeFloat64, "", "text/plain", false},
89+
{"Test A Float64 0.0", "0.0", 0.0, common.ValueTypeFloat64, "", "text/plain", false},
8890
{"Test A Float64 error", "Random", nil, common.ValueTypeFloat64, "", "text/plain", true},
8991
{"Test A Uint8", "255", uint8(255), common.ValueTypeUint8, "", "text/plain", false},
9092
{"Test A Uint8 error", "FF", nil, common.ValueTypeUint8, "", "text/plain", true},

0 commit comments

Comments
 (0)