diff --git a/test/expected/cast.out b/test/expected/cast.out index c180fe6..621c0da 100644 --- a/test/expected/cast.out +++ b/test/expected/cast.out @@ -140,6 +140,28 @@ SELECT '{1e-8,-1e-8}'::real[]::halfvec; [0,-0] (1 row) +SELECT '{1,2,3}'::int[]::intvec; + intvec +--------- + [1,2,3] +(1 row) + +SELECT '{1,2,3}'::int[]::intvec(3); + intvec +--------- + [1,2,3] +(1 row) + +SELECT '{1,2,3}'::int[]::intvec(2); +ERROR: expected 2 dimensions, not 3 +SELECT '{127,-128}'::int[]::intvec; + intvec +------------ + [127,-128] +(1 row) + +SELECT '{128,-129}'::int[]::intvec; +ERROR: value "128" is out of range for type intvec SELECT '[0,1.5,0,3.5,0]'::vector::sparsevec; sparsevec ----------------- diff --git a/test/sql/cast.sql b/test/sql/cast.sql index fe83931..34f94fe 100644 --- a/test/sql/cast.sql +++ b/test/sql/cast.sql @@ -38,6 +38,12 @@ SELECT '{1,2,3}'::real[]::halfvec(2); SELECT '{65520,-65520}'::real[]::halfvec; SELECT '{1e-8,-1e-8}'::real[]::halfvec; +SELECT '{1,2,3}'::int[]::intvec; +SELECT '{1,2,3}'::int[]::intvec(3); +SELECT '{1,2,3}'::int[]::intvec(2); +SELECT '{127,-128}'::int[]::intvec; +SELECT '{128,-129}'::int[]::intvec; + SELECT '[0,1.5,0,3.5,0]'::vector::sparsevec; SELECT '[0,1.5,0,3.5,0]'::vector::sparsevec(5); SELECT '[0,1.5,0,3.5,0]'::vector::sparsevec(4);