String interpolation! #1149

This commit is contained in:
Mike Farah
2024-03-05 14:10:12 +11:00
parent 152b158411
commit e092329bf3
8 changed files with 435 additions and 198 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
setUp() {
rm test*.yml || true
cat >test.yml <<EOL
# comment
EOL
}
testStringInterpolation() {
X=$(./yq -n '"Mike \(3 + 4)"')
assertEquals "Mike 7" "$X"
}
testNoStringInterpolation() {
X=$(./yq --string-interpolation=f -n '"Mike \(3 + 4)"')
assertEquals "Mike \(3 + 4)" "$X"
}
source ./scripts/shunit2