test more complex stream
[scpubgit/DKit.git] / t / basic.t
index 3bd0684..1655c85 100644 (file)
--- a/t/basic.t
+++ b/t/basic.t
@@ -77,8 +77,6 @@ is($stream->next->{'S'}, $_)
 
 is($stream->next, undef, 'No more');
 
-exit 0;
-
 my $complex_op = FromCode->new(
   code => bind_array(S => \@servers),
   next => FromCode->new(
@@ -96,10 +94,15 @@ my $cstream = DX::ResultStream->new(
   for_state => make_state([ qw(S P) ], $complex_op)
 );
 
-::Dwarn($cstream->next);
-::Dwarn($cstream->next);
-::Dwarn($cstream->next);
-::Dwarn($cstream->next);
-::Dwarn($cstream->next);
+is_deeply(
+  [ $cstream->results ],
+  [
+    { P => 'csh', S => 'jim.example.com' },
+    { P => 'csh', S => 'joe.example.com' },
+    { P => 'bash', S => 'joe.example.com' },
+    { P => 'csh', S => 'bob.example.com' },
+  ],
+  'Complex stream'
+);
 
 done_testing;