# file      : tests/dependency/chain/testscript
# license   : MIT; see accompanying LICENSE file

.include ../../common.testscript

: basics
:
$* <<EOI 2>>/~%EOE%
./: dir{x}: dir{a}
dump dir{x}
EOI
<stdin>:2:1: dump:
%  .+/dir\{x/\}: .+:dir\{a/\}%
EOE

: long
:
$* <<EOI 2>>/~%EOE%
./: dir{x}: dir{y}: dir{a}
dump dir{x} dir{y}
EOI
<stdin>:2:1: dump:
%  .+/dir\{x/\}: .+:dir\{y/\}%

%  .+/dir\{y/\}: .+:dir\{a/\}%
EOE

: multiple
:
$* <<EOI 2>>/~%EOE%
./: dir{x} dir{y}: dir{a} dir{b}
dump dir{x} dir{y}
EOI
<stdin>:2:1: dump:
%  .+/dir\{x/\}: .+:dir\{a/\} .+:dir\{b/\}%

%  .+/dir\{y/\}: .+:dir\{a/\} .+:dir\{b/\}%
EOE

: var-prereq
:
$* <<EOI 2>>/~%EOE%
./: dir{x}: dir{a}: x = y
dump dir{x}
EOI
<stdin>:2:1: dump:
%  .+/dir\{x/\}: .+:dir\{a/\}:%
  {
    x = y
  }
EOE

: var-prereq-block
:
$* <<EOI 2>>/~%EOE%
./: dir{x}: dir{a}:
{
  x = y
  z = x
}
dump dir{x}
EOI
<stdin>:6:1: dump:
%  .+/dir\{x/\}: .+:dir\{a/\}:%
  {
    x = y
    z = x
  }
EOE

: var-target-block
:
$* <<EOI 2>>/~%EOE%
./: dir{x}: dir{a}
{
  x = y
  z = x
}
dump dir{x}
EOI
<stdin>:6:1: dump:
%  .+/dir\{x/\}: .+:dir\{a/\}%
  {
    x = y
    z = x
  }
EOE
