From 453e5417f8ba8b928fe2efaaa3f972846b4bbb85 Mon Sep 17 00:00:00 2001 From: Michael Baird Date: Tue, 27 Jun 2017 10:02:25 -0500 Subject: [PATCH] removed float64 check in single row boolean --- input_definition.go | 6 ------ input_definition_test.go | 16 ++++++---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/input_definition.go b/input_definition.go index 28b49b180..b7f92a3a2 100644 --- a/input_definition.go +++ b/input_definition.go @@ -346,12 +346,6 @@ func HandleAction(a Action, value interface{}, colID uint64) (*Bit, error) { } else { // value is not True. return nil, err } - case float64: - if value.(float64) >= 1 { - bit.RowID = *a.RowID - } else { // value is not True. - return nil, err - } default: return nil, fmt.Errorf("single-row-boolean value %v must equate to a Bool", value) } diff --git a/input_definition_test.go b/input_definition_test.go index 86639c653..0c03083f7 100644 --- a/input_definition_test.go +++ b/input_definition_test.go @@ -171,17 +171,10 @@ func TestHandleAction(t *testing.T) { t.Fatalf("Expected Unrecognized Value Destination error, actual error: %s", err) } - value = float64(1.5) + value = float64(1) b, err = pilosa.HandleAction(action, value, colID) - if b != nil { - if b.RowID != 100 { - t.Fatalf("Unexpected rowID %v", b.RowID) - } - } - value = float64(0) - b, err = pilosa.HandleAction(action, value, colID) - if b != nil { - t.Fatalf("Expected Ignore values that do not equate to True") + if !strings.Contains(err.Error(), "must equate to a Bool") { + t.Fatalf("Expected Unrecognized Value Destination error, actual error: %s", err) } value = false @@ -196,6 +189,9 @@ func TestHandleAction(t *testing.T) { if b.ColumnID != 0 { t.Fatalf("Unexpected ColumnID %v", b.ColumnID) } + if b.RowID != 100 { + t.Fatalf("Unexpected rowID %v", b.RowID) + } } action.ValueDestination = pilosa.InputValueToRow