mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-01 18:21:16 +08:00
Improved test [skip ci]
This commit is contained in:
@@ -18,16 +18,18 @@ $node->safe_psql("postgres", qq(
|
||||
) i;
|
||||
));
|
||||
|
||||
# Test matches real
|
||||
my $r1 = $node->safe_psql("postgres", "SELECT AVG(r1)::float4 FROM tst;");
|
||||
my $r2 = $node->safe_psql("postgres", "SELECT AVG(r2)::float4 FROM tst;");
|
||||
my $r3 = $node->safe_psql("postgres", "SELECT AVG(r3)::float4 FROM tst;");
|
||||
# Test avg
|
||||
my $avg = $node->safe_psql("postgres", "SELECT AVG(v) FROM tst;");
|
||||
is($avg, "[$r1,$r2,$r3]");
|
||||
like($avg, qr/\[1\.5/);
|
||||
like($avg, qr/,2\.5/);
|
||||
like($avg, qr/,3\.5/);
|
||||
|
||||
# Test matches real
|
||||
my $r1 = $node->safe_psql("postgres", "SELECT AVG(r1)::float4 FROM tst;");
|
||||
my $r2 = $node->safe_psql("postgres", "SELECT AVG(r2)::float4 FROM tst;");
|
||||
my $r3 = $node->safe_psql("postgres", "SELECT AVG(r3)::float4 FROM tst;");
|
||||
is($avg, "[$r1,$r2,$r3]");
|
||||
|
||||
# Test explain
|
||||
my $explain = $node->safe_psql("postgres", "EXPLAIN SELECT AVG(v) FROM tst;");
|
||||
like($explain, qr/Partial Aggregate/);
|
||||
|
||||
Reference in New Issue
Block a user