fix the test and the operator mapping.

pull/17/head
John Shahid 2013-10-16 17:07:44 -04:00
parent 52748948e0
commit b47a658555
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ func init() {
registeredOperators[">="] = GreaterThanOrEqualOperator
registeredOperators[">"] = GreaterThanOperator
registeredOperators["<"] = not(GreaterThanOrEqualOperator)
registeredOperators[">"] = not(GreaterThanOperator)
registeredOperators["<="] = not(GreaterThanOperator)
registeredOperators["~="] = RegexMatcherOperator
}
@ -166,6 +166,6 @@ func GreaterThanOperator(leftType, rightType protocol.FieldDefinition_Type, left
case protocol.FieldDefinition_DOUBLE:
return *leftValue.DoubleValue > *rightValue.DoubleValue, nil
default:
return false, fmt.Errorf("Cannot use >= with type %v", cType)
return false, fmt.Errorf("Cannot use > with type %v", cType)
}
}

View File

@ -961,5 +961,5 @@ func (self *EngineSuite) TestInequalityFiltering(c *C) {
c.Assert(result, NotNil)
c.Assert(result.Points, HasLen, 1)
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))
}