#!/usr/bin/env bash
#
# System-Tools
# Copyright (C) 2002-2026 by Thomas Dreibholz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Contact: thomas.dreibholz@gmail.com
#

# Bash options:
set -euo pipefail

try-hard 3 1 --verbose -- false || try-hard 3 1 --verbose -- true

try-hard 1 6 --verbose -- true
try-hard 1 6 --verbose -- false && false
try-hard 3 3.0 -q -- false && false
try-hard 3 0.65 -- false && false
try-hard 5 0.10 -w -- false && false
try-hard 5 0.20 --min-delay 1.0 --multiplicative-increase 2.0 --truncate-delay 3600.0 -w -- false && false
try-hard 5 0.10 -m 0.1 -M 0.2 -T 3.6 -w -- false && false
try-hard 5 0.1 --min-delay 0.05 --additive-increase 0.5 --truncate-delay 3.0 -w -- false && false
try-hard 5 0.1 -m 0.1 -A 0.5 -T 3.0 -w -- false && false
try-hard 10 1.0 --deterministic -w -- false && false
try-hard 10 1.0 -D -w -- false && false
try-hard try-hard --version || false
try-hard try-hard --help || false

echo "Test passed!"
