#!/bin/sh
set -ex

# This test was written in response to: https://launchpad.net/bugs/1242363
# Author: Robie Basak <robie.basak@ubuntu.com>

cat > "$ADTTMP/test.pp" <<EOT
class foo(\$content="abc\\n") {
    file { '$ADTTMP/test-result': content => \$content; }
}

class {foo:}
EOT

rm -f "$ADTTMP/test-result"
puppet apply "$ADTTMP/test.pp"
result=`cat "$ADTTMP/test-result"`

test "$result" = "abc"
