assert res[1] == [val]
-@pytest.mark.parametrize("array, type", [([1, 32767], "int2"), ([1, 32768], "int4")])
-def test_array_mixed_numbers(array, type):
+@pytest.mark.parametrize(
+ "array, type",
+ [
+ ([0], "int2"),
+ ([1, 2**15 - 1], "int2"),
+ ([1, -(2**15)], "int2"),
+ ([1, 2**15], "int4"),
+ ([1, 2**31 - 1], "int4"),
+ ([1, -(2**31)], "int4"),
+ ([1, 2**31], "int8"),
+ ([1, 2**63 - 1], "int8"),
+ ([1, -(2**63)], "int8"),
+ ([1, 2**63], "numeric"),
+ ],
+)
+@pytest.mark.parametrize("fmt_in", PyFormat)
+def test_numbers_array(array, type, fmt_in):
tx = Transformer()
- dumper = tx.get_dumper(array, PyFormat.BINARY)
+ dumper = tx.get_dumper(array, fmt_in)
dumper.dump(array)
assert dumper.oid == builtins[type].array_oid