dagger input bool implementation
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
@@ -369,6 +369,35 @@ setup() {
|
||||
"$DAGGER" -e "input-subdir-git" up
|
||||
}
|
||||
|
||||
@test "dagger input bool" {
|
||||
"$DAGGER" init
|
||||
|
||||
## Test simple input git
|
||||
dagger_new_with_plan "input-simple-bool" "$TESTDIR"/cli/input/bool
|
||||
|
||||
# input git
|
||||
"$DAGGER" -e "input-simple-bool" input list --show-optional
|
||||
run "$DAGGER" -e "input-simple-bool" query first
|
||||
assert_output 'false'
|
||||
run "$DAGGER" -e "input-simple-bool" query second
|
||||
assert_output '{}'
|
||||
|
||||
"$DAGGER" -e "input-simple-bool" input bool first true
|
||||
run "$DAGGER" -e "input-simple-bool" query first
|
||||
assert_output 'true'
|
||||
run "$DAGGER" -e "input-simple-bool" query second
|
||||
assert_output 'true'
|
||||
|
||||
"$DAGGER" -e "input-simple-bool" input bool first false
|
||||
run "$DAGGER" -e "input-simple-bool" query first
|
||||
assert_output 'false'
|
||||
run "$DAGGER" -e "input-simple-bool" query second
|
||||
assert_output '{}'
|
||||
|
||||
run "$DAGGER" -e "input-simple-bool" input bool first Anything
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "dagger input list" {
|
||||
"$DAGGER" init
|
||||
|
||||
|
11
tests/cli/input/bool/main.cue
Normal file
11
tests/cli/input/bool/main.cue
Normal file
@@ -0,0 +1,11 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/dagger"
|
||||
)
|
||||
|
||||
first: dagger.#Input & {bool | *false}
|
||||
|
||||
if first == true {
|
||||
second: true
|
||||
}
|
Reference in New Issue
Block a user