#
# Verify that a task whose input/output is a user-defined enum declared
# *inline* in the pipeline script can be resumed from the cache.
# Regression test for https://github.com/nextflow-io/nextflow/issues/4816
#
set -e

#
# run normal mode
#
$NXF_RUN | tee .stdout

[[ `grep INFO .nextflow.log | grep -c 'Submitted process'` == 1 ]] || false

#
# run resume mode -- the task must be served from the cache
#
$NXF_RUN -resume | tee .stdout

[[ `grep INFO .nextflow.log | grep -c 'Cached process'` == 1 ]] || false
