use of com.google.cloud.spanner.pgadapter.parsers.LongParser in project pgadapter by GoogleCloudPlatform.
the class ParserTest method testPositiveLongParsing.
@Test
public void testPositiveLongParsing() {
long value = 1234567890L;
byte[] byteResult = { 0, 0, 0, 0, 73, -106, 2, -46 };
byte[] stringResult = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
Parser parsedValue = new LongParser(value);
validate(parsedValue, byteResult, stringResult, stringResult);
validateCreateBinary(byteResult, Oid.INT8, value);
validateCreateText(stringResult, Oid.INT8, value);
}
use of com.google.cloud.spanner.pgadapter.parsers.LongParser in project pgadapter by GoogleCloudPlatform.
the class ParserTest method testNegativeLongParsing.
@Test
public void testNegativeLongParsing() {
long value = -1234567890L;
byte[] byteResult = { -1, -1, -1, -1, -74, 105, -3, 46 };
byte[] stringResult = { '-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
Parser parsedValue = new LongParser(value);
validate(parsedValue, byteResult, stringResult, stringResult);
validateCreateBinary(byteResult, Oid.INT8, value);
validateCreateText(stringResult, Oid.INT8, value);
}
Aggregations