File: live-invalid-domain.t

package info (click to toggle)
libhijk-perl 0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 332 kB
  • ctags: 198
  • sloc: perl: 3,070; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env perl

use strict;
use warnings;
use Hijk;
use Test::More;

unless ($ENV{TEST_LIVE}) {
    plan skip_all => "Enable live testing by setting env: TEST_LIVE=1";
}

my $res = Hijk::request({
    method => "GET",
    host   => "hlagh.google.com",
    port   => "80",
});
ok exists $res->{error}, "We got an error back for this invalid domain";
is $res->{error}, Hijk::Error::CANNOT_RESOLVE, "We can't resolve the domain";

done_testing;