Skip to content

assert_true/assert_false with empty valuegives misleading assertion error #638

@RevanProdigalKnight

Description

@RevanProdigalKnight
Q A
OS Linux (Cygwin on Windows)
Shell & version bash 5.2.21(1)-release
bashunit version 0.34.1

Summary

assert_true and assert_false both give misleading output if the value given is empty because they continue past the case statement and attempt to eval an empty string

Current behavior

Expected 'command or function with zero exit code'
but got  'exit code: 127'

How to reproduce

empty_var=''
assert_true "$empty_var"
assert_false "$empty_var

Expected behavior

Expected 'true or 0'
Got ''

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions