Skip to content
Myr

assert_not_ok

This file

Path

test/fast/Unit tests/assert_not_ok

17 lines · 457 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.sh67_returns_zero() { return 0; }8_returns_nonzero() { return 1; }910# assert_not_ok should pass for a non-zero-exit function11assert_not_ok _returns_nonzero \12  || die 'assert_not_ok failed on a function that returns 1'1314# assert_not_ok should fail for a zero-exit function15if (assert_not_ok _returns_zero 2>/dev/null); then16  die 'assert_not_ok incorrectly passed for a function that returns 0'17fi