### ----------------------------------------------------
### -- ake
### -- Licenses: Artistic-2.0
### -- Authors: Jonathan Scott Duff <duff@pobox.com>, Alex Daniel, the Raku Community
### -- File: t/23-deps.t
### ----------------------------------------------------
use v6.c;
use lib <lib/ t/lib>;
use Ake;
use AkeTester;
use Test;

plan 4;

given make-ake-directory ｢
task ‘A’,        { say ‘A!’ }
task ‘B’ => ‘A’, { say ‘B!’ }
｣ {
    test-run ‘one basic dep’, <ake B>, :out(“A!\nB!\n”);
}

given make-ake-directory ｢
task ‘A’,        { say ‘A!’ }
task ‘B’ => ‘A’, { say ‘B!’ }
task ‘C’ => ‘B’, { say ‘C!’ }
task ‘D’ => ‘C’, { say ‘D!’ }
｣ {
    test-run ‘dependecy chain’, <ake D>, :out(“A!\nB!\nC!\nD!\n”);
}

given make-ake-directory ｢
task ‘A’,          { say ‘A!’ }
task ‘B’,          { say ‘B!’ }
task ‘C’ => <A B>, { say ‘C!’ }
｣ {
    test-run ‘multiple dependencies’, <ake C>, :out(“A!\nB!\nC!\n”);
}

given make-ake-directory ｢
task ‘F’ => <D E>, { say ‘F!’ }
task ‘B’,          { say ‘B!’ }
task ‘D’ => <A C>, { say ‘D!’ }
task ‘A’,          { say ‘A!’ }
task ‘E’,          { say ‘E!’ }
task ‘C’ => <A B>, { say ‘C!’ }
｣ {
    test-run ‘shuffled dep tree’, <ake F>, :out(“A!\nB!\nC!\nD!\nE!\nF!\n”);
}

# TODO IO tasks?


