removed float64 check in single row boolean

This commit is contained in:
Michael Baird 2017-06-27 10:02:25 -05:00
parent def02c45e7
commit 16db983bf1
2 changed files with 6 additions and 16 deletions

View file

@ -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)
}

View file

@ -179,17 +179,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
@ -204,6 +197,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