fix the test and the operator mapping.
parent
52748948e0
commit
b47a658555
|
@ -18,7 +18,7 @@ func init() {
|
||||||
registeredOperators[">="] = GreaterThanOrEqualOperator
|
registeredOperators[">="] = GreaterThanOrEqualOperator
|
||||||
registeredOperators[">"] = GreaterThanOperator
|
registeredOperators[">"] = GreaterThanOperator
|
||||||
registeredOperators["<"] = not(GreaterThanOrEqualOperator)
|
registeredOperators["<"] = not(GreaterThanOrEqualOperator)
|
||||||
registeredOperators[">"] = not(GreaterThanOperator)
|
registeredOperators["<="] = not(GreaterThanOperator)
|
||||||
registeredOperators["~="] = RegexMatcherOperator
|
registeredOperators["~="] = RegexMatcherOperator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,6 +166,6 @@ func GreaterThanOperator(leftType, rightType protocol.FieldDefinition_Type, left
|
||||||
case protocol.FieldDefinition_DOUBLE:
|
case protocol.FieldDefinition_DOUBLE:
|
||||||
return *leftValue.DoubleValue > *rightValue.DoubleValue, nil
|
return *leftValue.DoubleValue > *rightValue.DoubleValue, nil
|
||||||
default:
|
default:
|
||||||
return false, fmt.Errorf("Cannot use >= with type %v", cType)
|
return false, fmt.Errorf("Cannot use > with type %v", cType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -961,5 +961,5 @@ func (self *EngineSuite) TestInequalityFiltering(c *C) {
|
||||||
c.Assert(result, NotNil)
|
c.Assert(result, NotNil)
|
||||||
c.Assert(result.Points, HasLen, 1)
|
c.Assert(result.Points, HasLen, 1)
|
||||||
c.Assert(*result.Points[0].Values[0].IntValue, Equals, int32(100))
|
c.Assert(*result.Points[0].Values[0].IntValue, Equals, int32(100))
|
||||||
c.Assert(*result.Points[0].Values[1].IntValue, Equals, int32(6))
|
c.Assert(*result.Points[0].Values[1].IntValue, Equals, int32(7))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue