### ----------------------------------------------------
### -- Needle::Compile
### -- Licenses: Artistic-2.0
### -- Authors: Elizabeth Mattijsen
### -- File: xt/02-url.rakutest
### ----------------------------------------------------
BEGIN %*ENV<RAKU_TEST_DIE_ON_FAIL> = 1;
use Test;
use Needle::Compile "Type";

my $url = 'raku.org/robots.txt';
my @urls =
  "url:$url",
  :$url,
  $url but Type<url>,
;

plan 3 * @urls;

for @urls {
    my &needle := compile-needle($_);
    isa-ok &needle, Callable, "Testing $_.raku()";

    is-deeply needle("User-Agent: *"), True, 'found target';
    is-deeply needle("User-Agent:"),  False, 'did NOT find target';
}

# vim: expandtab shiftwidth=4


