assert_ok
This file
Path
test/fast/Unit tests/assert_ok
17 lines · 433 bytes
Last changed by
[tests] remove double-substitution in assert_ok and assert_not_okАндрій Шовкошитнийbefore adoption20d52b6
History of this fileTake it
[tests] remove double-substitution in assert_ok and assert_not_okАндрій Шовкошитнийbefore adoption20d52b6
lines 1–17why, one step back1#!/bin/sh23die () { echo "$@" ; exit 1; }45\. ../../common.sh67_returns_zero() { return 0; }8_returns_nonzero() { return 1; }910# assert_ok should pass for a zero-exit function11assert_ok _returns_zero \12 || die 'assert_ok failed on a function that returns 0'1314# assert_ok should fail for a non-zero-exit function15if (assert_ok _returns_nonzero 2>/dev/null); then16 die 'assert_ok incorrectly passed for a function that returns 1'17fi