### ----------------------------------------------------
### -- CompUnit::Repository::Tar
### -- Licenses: Artistic-2.0
### -- Authors: ugexe
### -- File: t/files.rakutest
### ----------------------------------------------------
use Test:ver<6.c+>;
plan 5;

use CompUnit::Repository::Tar;
use lib "CompUnit::Repository::Tar#{CompUnit::Repository::Tar.test-dist('Distribution--Common-v0.1.0.tar.gz')}";


subtest 'name-path only' => {
    ok  $*REPO.repo-chain[0].files("bin/install-raku-distribution.rakumod");
    nok $*REPO.repo-chain[0].files("bin/xxx");
}

subtest 'name-path and distribution name' => {
    ok  $*REPO.repo-chain[0].files("bin/install-raku-distribution.rakumod", name => "Distribution::Common");
    nok $*REPO.repo-chain[0].files("bin/install-raku-distribution.rakumod", name => "xxx");
}

subtest 'name-path and distribution auth' => {
    ok  $*REPO.repo-chain[0].files("bin/install-raku-distribution.rakumod", auth => "github:ugexe");
    nok $*REPO.repo-chain[0].files("bin/install-raku-distribution.rakumod", auth => "github:xxx");
}

subtest 'name-path and distribution ver' => {
    ok  $*REPO.repo-chain[0].files("bin/install-raku-distribution.rakumod", ver => "*");
}

subtest 'name-path and distribution name/auth/ver' => {
    ok  $*REPO.repo-chain[0].files("bin/install-raku-distribution.rakumod", name => "Distribution::Common", auth => "github:ugexe", ver => "*");
    nok $*REPO.repo-chain[0].files("bin/xxx", name => "Distribution::Common", auth => "github:ugexe", ver => "*");
}

done-testing;


