osi-tools/test/osi-extract.bats

39 lines
1.1 KiB
Bash

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