diff --git a/tests/cli.bats b/tests/cli.bats index e5e0f81f..9b075158 100644 --- a/tests/cli.bats +++ b/tests/cli.bats @@ -320,3 +320,35 @@ setup() { run bash -c "echo \"$outAll\" | grep cfg.strSet | grep string | grep pipo" assert_success } + +@test "dagger output list" { + "$DAGGER" init + + dagger_new_with_plan list "$TESTDIR"/cli/output/list + + run "$DAGGER" output list -e "list" + assert_failure + + "$DAGGER" up -e "list" + + out="$("$DAGGER" output list -e "list")" + outAll="$("$DAGGER" output list --all -e "list")" + + run bash -c "echo \"$out\" | grep cfgInline.url | grep 'http://this.is.a.test/' | grep 'test url description'" + assert_success + + run bash -c "echo \"$out\" | grep cfg.url | grep 'http://this.is.a.test/' | grep 'test url description'" + assert_success + + run bash -c "echo \"$out\" | grep cfg2.url | grep 'http://this.is.a.test/' | grep 'test url description'" + assert_success + + run bash -c "echo \"$out\" | grep cfg.str" + assert_failure + + run bash -c "echo \"$outAll\" | grep cfg.str" + assert_success + + run bash -c "echo \"$outAll\" | grep cfg2.url" + assert_success +} diff --git a/tests/cli/output/list/main.cue b/tests/cli/output/list/main.cue new file mode 100644 index 00000000..9aa65e75 --- /dev/null +++ b/tests/cli/output/list/main.cue @@ -0,0 +1,19 @@ +package main + +#A: { + // a string + str: string @dagger(output) + strSet: "pipo" @dagger(input) + strDef: *"yolo" | string @dagger(input) + + // test url description + url: "http://this.is.a.test/" @dagger(output) + url2: url +} + +cfgInline: { + #A +} + +cfg: #A +cfg2: cfg