Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed tests and added expression parser test for double
  • Loading branch information
srinathshankar committed Aug 20, 2016
commit 19582ff633932c3ec0a6804bec9314a3390a6404
Original file line number Diff line number Diff line change
Expand Up @@ -375,19 +375,21 @@ class ExpressionParserSuite extends PlanTest {

// Tiny Int Literal
assertEqual("10Y", Literal(10.toByte))
intercept("-1000Y", s"does not fit in range [-${Byte.MinValue}, ${Byte.MaxValue}]")
intercept("-1000Y", s"does not fit in range [${Byte.MinValue}, ${Byte.MaxValue}]")

// Small Int Literal
assertEqual("10S", Literal(10.toShort))
intercept("40000S", s"does not fit in range [-${Short.MinValue}, ${Short.MaxValue}]")
intercept("40000S", s"does not fit in range [${Short.MinValue}, ${Short.MaxValue}]")

// Long Int Literal
assertEqual("10L", Literal(10L))
intercept("78732472347982492793712334L",
s"does not fit in range [-${Long.MinValue}, ${Long.MaxValue}]")
s"does not fit in range [${Long.MinValue}, ${Long.MaxValue}]")

// Double Literal
assertEqual("10.0D", Literal(10.0D))
intercept("-1.8E308D", s"does not fit in range")
intercept("1.8E308D", s"does not fit in range")
// TODO we need to figure out if we should throw an exception here!
assertEqual("1E309", Literal(Double.PositiveInfinity))
}
Expand Down