use of com.google.cloud.spanner.pgadapter.parsers.DoubleParser in project pgadapter by GoogleCloudPlatform.
the class ParserTest method testNegativeDoubleParsing.
@Test
public void testNegativeDoubleParsing() {
double value = -1234.56789d;
byte[] byteResult = { -64, -109, 74, 69, -124, -12, -58, -25 };
byte[] stringResult = { '-', '1', '2', '3', '4', '.', '5', '6', '7', '8', '9' };
Parser parsedValue = new DoubleParser(value);
validate(parsedValue, byteResult, stringResult, stringResult);
validateCreateBinary(byteResult, Oid.FLOAT8, value);
validateCreateText(stringResult, Oid.FLOAT8, value);
}
use of com.google.cloud.spanner.pgadapter.parsers.DoubleParser in project pgadapter by GoogleCloudPlatform.
the class ParserTest method testPositiveDoubleParsing.
@Test
public void testPositiveDoubleParsing() {
double value = 1234.56789d;
byte[] byteResult = { 64, -109, 74, 69, -124, -12, -58, -25 };
byte[] stringResult = { '1', '2', '3', '4', '.', '5', '6', '7', '8', '9' };
Parser parsedValue = new DoubleParser(value);
validate(parsedValue, byteResult, stringResult, stringResult);
validateCreateBinary(byteResult, Oid.FLOAT8, value);
validateCreateText(stringResult, Oid.FLOAT8, value);
}
Aggregations