Skip to content
Myr

make_echo

This file

Path

test/fast/Unit tests/make_echo

22 lines · 521 bytes

Last changed by

[tests] remove double-substitution in assert_ok and assert_not_okАндрій Шовкошитнийbefore adoption20d52b6

History of this file

Take it

1#!/bin/sh23die () { echo "$@" ; exit 1; }45\. ../../common.sh67TMPFILE="$(mktemp)"8trap 'rm -f "${TMPFILE}"' EXIT910make_echo "${TMPFILE}" "hello_nvm" || die 'make_echo returned non-zero'1112# shebang must still be on line 113[ "$(head -n 1 "${TMPFILE}")" = '#!/bin/sh' ] \14  || die 'make_echo overwrote the shebang'1516# script body must be present17grep -q 'hello_nvm' "${TMPFILE}" \18  || die 'make_echo did not write the echo body'1920# file must be executable21[ -x "${TMPFILE}" ] \22  || die 'make_echo did not chmod the file'