1271593Sjilles# $FreeBSD: releng/11.0/bin/sh/tests/parser/heredoc12.0 271593 2014-09-14 16:46:30Z jilles $ 2271593Sjilles 3271593Sjillesfailures=0 4271593Sjilles 5271593Sjillescheck() { 6271593Sjilles if ! eval "[ $* ]"; then 7271593Sjilles echo "Failed: $*" 8271593Sjilles : $((failures += 1)) 9271593Sjilles fi 10271593Sjilles} 11271593Sjilles 12271593Sjilleslongmark=`printf %01000d 4` 13271593Sjilleslongmarkstripped=`printf %0999d 0` 14271593Sjilles 15271593Sjillescheck '"$(cat <<'"$longmark 16271593Sjilles$longmark"' 17271593Sjillesecho yes)" = "yes"' 18271593Sjilles 19271593Sjillescheck '"$(cat <<\'"$longmark 20271593Sjilles$longmark"' 21271593Sjillesecho yes)" = "yes"' 22271593Sjilles 23271593Sjillescheck '"$(cat <<'"$longmark 24271593Sjillesyes 25271593Sjilles$longmark"' 26271593Sjilles)" = "yes"' 27271593Sjilles 28271593Sjillescheck '"$(cat <<\'"$longmark 29271593Sjillesyes 30271593Sjilles$longmark"' 31271593Sjilles)" = "yes"' 32271593Sjilles 33271593Sjillescheck '"$(cat <<'"$longmark 34271593Sjilles$longmarkstripped 35271593Sjilles$longmark. 36271593Sjilles$longmark"' 37271593Sjilles)" = "'"$longmarkstripped 38271593Sjilles$longmark."'"' 39271593Sjilles 40271593Sjillescheck '"$(cat <<\'"$longmark 41271593Sjilles$longmarkstripped 42271593Sjilles$longmark. 43271593Sjilles$longmark"' 44271593Sjilles)" = "'"$longmarkstripped 45271593Sjilles$longmark."'"' 46271593Sjilles 47271593Sjillesexit $((failures != 0)) 48