diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8ba7434..438641f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -125,6 +125,7 @@ jobs: - { name: "uml", backend: "--fakemachine-backend=uml" } test: - { name: "recipes", case: "recipes" } + - { name: "escaping", case: "escaping", variables: " -t escaped:\\$ba\\'d\\$gers\\ snakes" } - { name: "debian (amd64)", case: "debian", variables: "-t architecture:amd64" } - { name: "debian (arm64)", case: "debian", variables: "-t architecture:arm64" } - { name: "debian (armhf)", case: "debian", variables: "-t architecture:armhf" } diff --git a/tests/escaping/test.yaml b/tests/escaping/test.yaml new file mode 100644 index 0000000..b24fd8c --- /dev/null +++ b/tests/escaping/test.yaml @@ -0,0 +1,20 @@ +# expected to be run with -t escaled:\$bad\'ge\$rs or similar to verify passing +# variables onwards +{{ $escaped := or .escaped "$mu'room$" }} +architecture: amd64 + +actions: + - action: run + description: test escaping + chroot: false + command: echo {{ escape $escaped }} > test.a + - action: run + description: test escaping + chroot: false + command: |- + cat << 'EOF' > test.b + {{ $escaped }} + EOF + - action: run + chroot: false + command: diff -u test.a test.b