File: 51awaitable-role.t

package info (click to toggle)
libfuture-asyncawait-perl 0.70-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 528 kB
  • sloc: perl: 2,647; ansic: 118; pascal: 34; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 624 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
23
24
25
26
27
#!/usr/bin/perl

use v5.14;
use warnings;

use Test2::V0;

eval { require Role::Tiny; 1 } or
   plan skip_all => "No Role::Tiny";

use Future::AsyncAwait::Awaitable;

pass( "doesn't crash" );

package Test::NotAwaitable {
   require Role::Tiny::With;
   Role::Tiny::With->import;

   ::ok( !eval {
      with( "Future::AsyncAwait::Awaitable" );
   }, 'Test package is not Future::AsyncAwait::Awaitable' );
   # Possibly a fragile test, in case of changes of error message text
   ::like( $@, qr/^Can't apply Future::AsyncAwait::Awaitable to Test::NotAwaitable /,
      'exception from unapplicable role' );
}

done_testing;