diff --git a/src/spec b/src/spec index 7449a9f..1946b6a 100644 --- a/src/spec +++ b/src/spec @@ -187,7 +187,7 @@ _handle-to() # shift argument allows the implementation to vary without breaking BC so # long as the meaning of the shifted arguments do not change $assert "$__spec_rexit" $__SHIFTN "$__spec_errpath" "$@" \ - <<< "$__spec_result" + < <( echo -n "$__spec_result" ) } diff --git a/test/test-spec b/test/test-spec index 8873f8f..b0bf626 100644 --- a/test/test-spec +++ b/test/test-spec @@ -193,6 +193,21 @@ describe expect end '; to succeed end + + # that is, if we use <<< to provide premise output from memory, a + # newline will be added; we don't want that! + it does not have newline added to premise output if missing + expect test-run <<< ' + _expect--chk() { test "$( wc -c )" -eq 0; } + + describe foo + it should not add newline + expect true + to chk + end + end + '; to succeed + end end