X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbasic.t;h=10e5d623cd68c86d25ad8973a580a6d4d8b7b15e;hb=71217e421021100f3b07945357bd2fdaac638c4b;hp=be3e32d363876c3166293881ebcbbdbb564cac79;hpb=5ef4d923edc14eadf67d64e92001f2f7bfa63986;p=scpubgit%2FDKit.git diff --git a/t/basic.t b/t/basic.t index be3e32d..10e5d62 100644 --- a/t/basic.t +++ b/t/basic.t @@ -78,7 +78,7 @@ sub make_state { my $stream = DX::ResultStream->new(for_state => make_state([ 'S' ], $op)); -is($stream->next->{'S'}, $_) +is($stream->next->{'S'}->bound_value, $_) for qw(jim.example.com joe.example.com bob.example.com); is($stream->next, undef, 'No more'); @@ -96,12 +96,21 @@ my $complex_op = FromCode->new( ) ); +sub bound_values { + map { + my $v = $_; + +{ + map +($_ => $v->{$_}->bound_value), keys %$v + } + } @_ +} + my $cstream = DX::ResultStream->new( for_state => make_state([ qw(S P) ], $complex_op) ); is_deeply( - [ $cstream->results ], + [ bound_values $cstream->results ], [ { P => 'csh', S => 'jim.example.com' }, { P => 'csh', S => 'joe.example.com' }, @@ -141,7 +150,7 @@ my $callstream = DX::ResultStream->new( ); is_deeply( - [ $callstream->results ], + [ bound_values $callstream->results ], [ { P => 'csh', S => 'jim.example.com' }, { P => 'csh', S => 'joe.example.com' }, @@ -182,7 +191,7 @@ my $orstream = DX::ResultStream->new( ); is_deeply( - [ $orstream->results ], + [ bound_values $orstream->results ], [ { S => "kitty.scsys.co.uk" @@ -218,7 +227,7 @@ my $orstream_2 = DX::ResultStream->new( ); is_deeply( - [ $orstream_2->results ], + [ bound_values $orstream_2->results ], [ { S => "jim.example.com"