Skip to content

fail fails to fail the test immediately #154

@gqqnbig

Description

@gqqnbig

blob/master/README.md says

fail [message]
Fails the test immediately.

I thus tried the following code.

$ cat t.sh
#!/bin/bash

testA() {
    fail "A"
    fail "B"

}

source shunit2

$ ./t.sh
testA
ASSERT:A
ASSERT:B
shunit2:ERROR testA() returned non-zero return code.

Ran 1 test.

FAILED (failures=2)

Because I was told fail fails the test immediately, I expect to only see ASSERT:A. However, I see ASSERT:A and ASSERT:B.

I don't know if it's a documentation bug or code bug. Please fix.

My version is 2.1.9pre.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions