2024-01-05 18:42:15 +00:00
|
|
|
# Copyright (C) 2024 Umorpha Systems
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2024-01-05 02:13:25 +00:00
|
|
|
bats_require_minimum_version 1.7.0
|
|
|
|
bats_load_library bats-support
|
|
|
|
bats_load_library bats-assert
|
|
|
|
|
|
|
|
@test "osi-shell needs arguments" {
|
|
|
|
LC_ALL=C run --separate-stderr osi-shell
|
|
|
|
assert_failure 2
|
|
|
|
assert_equal "$output" ''
|
|
|
|
assert [ ${#stderr_lines[@]} -gt 1 ]
|
|
|
|
assert_regex "${stderr_lines[-1]}" "^Try .*osi-shell --help' for more information\$"
|
|
|
|
}
|
2024-02-14 03:00:05 +00:00
|
|
|
|
|
|
|
@test "osi-shell shows help" {
|
|
|
|
LC_ALL=C run --separate-stderr osi-shell --help
|
|
|
|
assert_success
|
|
|
|
assert_equal "$stderr" ''
|
|
|
|
assert_regex "${lines[0]}" '^Usage: osi-shell '
|
|
|
|
|
|
|
|
LC_ALL=C run --separate-stderr osi-shell -h
|
|
|
|
assert_success
|
|
|
|
assert_equal "$stderr" ''
|
|
|
|
assert_regex "${lines[0]}" '^Usage: osi-shell'
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "osi-shell shows version" {
|
|
|
|
LC_ALL=C run --separate-stderr osi-shell --version
|
|
|
|
assert_success
|
|
|
|
assert_equal "$stderr" ''
|
|
|
|
assert_regex "${lines[0]}" '^osi-shell \(osi-tools\) '
|
|
|
|
|
|
|
|
LC_ALL=C run --separate-stderr osi-shell -V
|
|
|
|
assert_success
|
|
|
|
assert_equal "$stderr" ''
|
|
|
|
assert_regex "${lines[0]}" '^osi-shell \(osi-tools\) '
|
|
|
|
}
|