set -e

#
# run normal mode
#
echo ''
$NXF_RUN | tee stdout

grep -c 'Submitted process > foo (alpha)' .nextflow.log
grep -c 'Submitted process > foo (delta)' .nextflow.log
grep -c 'Submitted process > foo (gamma)' .nextflow.log
grep -c 'Submitted process > foo (omega)' .nextflow.log

grep 'alpha' stdout
grep 'delta' stdout
grep 'gamma' stdout
grep 'omega' stdout


#
# run resume mode
#
echo ''
$NXF_RUN -resume| tee stdout

grep -c 'Cached process > foo (alpha)' .nextflow.log
grep -c 'Cached process > foo (delta)' .nextflow.log
grep -c 'Cached process > foo (gamma)' .nextflow.log
grep -c 'Cached process > foo (omega)' .nextflow.log

grep 'alpha' stdout
grep 'delta' stdout
grep 'gamma' stdout
grep 'omega' stdout
