Skip to content

Instantly share code, notes, and snippets.

@tene
Created December 3, 2008 00:12
Show Gist options
  • Save tene/31358 to your computer and use it in GitHub Desktop.
Save tene/31358 to your computer and use it in GitHub Desktop.
use strict;
use Coro::State;
use Test::More tests => 2;
my $input;
my $main = new Coro::State;
our $tests = new Coro::State sub {
our $tests;
is($input,'foo', 'input is foo');
$tests->transfer($main);
is($input,'bar', 'input is bar');
$tests->transfer($main);
};
sub callback {
$input = shift;
$main->transfer($tests);
}
callback('foo');
callback('bar');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment