File: 01-backend-selection.t

package info (click to toggle)
libfuture-http-perl 0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 276 kB
  • sloc: perl: 1,320; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (2)
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
28
#!perl -w
use strict;
use Test::More;
use Data::Dumper;
use Future::HTTP;

my $ok = eval {
    require Test::Without::Module;
    require Future::HTTP::AnyEvent;
    1;
} || eval {
    require Test::Without::Module;
    require Future::HTTP::Mojo;
    1;
};

if( $ok ) {
    plan( tests => 2 );
} else {
    plan( skip_all => "No backend other than IO::Async available" );
};

Test::Without::Module->import( qw( HTTP::Tiny ) );
isnt( Future::HTTP->best_implementation, 'Future::HTTP::Tiny',
    "We select a different socket backend if HTTP::Tiny is unavailable");

isnt( Future::HTTP->best_implementation, 'Future::HTTP::Tiny',
    "We select a different pipe backend if HTTP::Tiny is unavailable");