### ----------------------------------------------------
### -- Pod::From::Cache
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth, aka finanalyst
### -- File: xt/99-cleanup.rakutest
### ----------------------------------------------------
use v6.d;
use Test;
use File::Directory::Tree;

plan 1;

if %*ENV<NoDelete> {
    skip-rest 'NoDelete set in environment';
}
else {
    rmtree "xt/$_" for <doctest cache>;
    my @xt = 'xt'.IO.dir.grep({ ($_ ~~ :e & :d ) and ($_ !~~ / \d+ \- /)});
    ok @xt.elems == 0, @xt.elems
        ?? ('sub-directories of ｢xt/｣ not all deleted, still got: ' ~ @xt>>.Str)
        !! 'all sub-directories of ｢xt/｣ deleted';
}

done-testing;


