File: live-invalid-domain.t

package info (click to toggle)
libhijk-perl 0.28-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 260 kB
  • sloc: perl: 1,372; makefile: 8
file content (20 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (4)
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;