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