Skip to content

Commit b14d973

Browse files
committed
Add a test for raftable list function.
1 parent 831195d commit b14d973

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

contrib/raftable/t/000_basic.pl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PostgresNode;
55
use TestLib;
6-
use Test::More tests => 4;
6+
use Test::More tests => 5;
77

88
sub genstr
99
{
@@ -79,7 +79,18 @@ sub start_nodes
7979
while (my ($key, $value) = each(%tests))
8080
{
8181
my $o = $baker->psql('postgres', "select raftable('$key');");
82-
is($o, $value, "Check that baker has all the state replicated");
82+
is($o, $value, "Baker has '$key'");
8383
}
8484

85+
my $ok = 1;
86+
my $o = $baker->psql('postgres', "select raftable();");
87+
while ($o =~ /\((\w+),(\w+)\)/g)
88+
{
89+
if (!exists $tests{$1}) { $ok = 0; last; }
90+
my $val = delete $tests{$1};
91+
if ($val ne $2) { $ok = 0; last; }
92+
}
93+
if (keys %tests > 0) { $ok = 0; }
94+
is($ok, 1, "Baker has everything");
95+
8596
exit(0);

0 commit comments

Comments
 (0)