test: implemented tests for input list

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba
2021-05-26 12:00:59 +02:00
parent 6568c4e6d1
commit 42e91c0a30
2 changed files with 77 additions and 0 deletions

View File

@@ -285,3 +285,36 @@ setup() {
"foo": "bar"
}'
}
@test "dagger input list" {
"$DAGGER" new --plan-dir "$TESTDIR"/cli/input/list "list"
"$DAGGER" input text cfg.str "foobar" -e "list"
out="$("$DAGGER" input list -e "list")"
outAll="$("$DAGGER" input list --all -e "list")"
#note: this is the recommended way to use pipes with bats
run bash -c "echo \"$out\" | grep awsConfig.accessKey | grep '#Secret' | grep false"
assert_success
run bash -c "echo \"$out\" | grep cfgInline.source | grep '#Artifact' | grep false | grep 'source dir'"
assert_success
run bash -c "echo \"$outAll\" | grep cfg2"
assert_failure
run bash -c "echo \"$out\" | grep cfgInline.strDef | grep string | grep 'yolo (default)' | grep false"
assert_success
run bash -c "echo \"$out\" | grep cfg.num"
assert_failure
run bash -c "echo \"$outAll\" | grep cfg.num | grep int"
assert_success
run bash -c "echo \"$out\" | grep cfg.strSet"
assert_failure
run bash -c "echo \"$outAll\" | grep cfg.strSet | grep string | grep pipo"
assert_success
}