File: 50future.t

package info (click to toggle)
libcps-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 252 kB
  • ctags: 31
  • sloc: perl: 977; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl

use strict;

use Test::More tests => 1;
use Test::Fatal;
use Test::Identity;
use Test::Refcount;

use CPS::Future;

# Callable
{
   my $future = CPS::Future->new;

   my @on_done_args;
   $future->on_done( sub { @on_done_args = @_ } );

   $future->( another => "result" );

   is_deeply( \@on_done_args, [ another => "result" ], '$future is directly callable' );
}