mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-14 15:18:06 +00:00
13d1bbb45f
Remove dependency on yaml.Node for internal AST representation. Yaml decoder is now just another decoder.
27 lines
743 B
Bash
Executable File
27 lines
743 B
Bash
Executable File
#!/bin/bash
|
|
|
|
testLoadFileNotExist() {
|
|
result=$(./yq e -n 'load("cat.yml")' 2>&1)
|
|
assertEquals 1 $?
|
|
assertEquals "Error: Failed to load cat.yml: open cat.yml: no such file or directory" "$result"
|
|
}
|
|
|
|
testLoadFileExpNotExist() {
|
|
result=$(./yq e -n 'load(.a)' 2>&1)
|
|
assertEquals 1 $?
|
|
assertEquals "Error: filename expression returned nil" "$result"
|
|
}
|
|
|
|
testStrLoadFileNotExist() {
|
|
result=$(./yq e -n 'strload("cat.yml")' 2>&1)
|
|
assertEquals 1 $?
|
|
assertEquals "Error: Failed to load cat.yml: open cat.yml: no such file or directory" "$result"
|
|
}
|
|
|
|
testStrLoadFileExpNotExist() {
|
|
result=$(./yq e -n 'strload(.a)' 2>&1)
|
|
assertEquals 1 $?
|
|
assertEquals "Error: filename expression returned nil" "$result"
|
|
}
|
|
|
|
source ./scripts/shunit2 |