1#!/bin/bash 2 3[ -f testing.sh ] && . testing.sh 4 5#testing "name" "command" "result" "infile" "stdin" 6 7testing "batch termination" "top -b -n1 | tail -c 1" "\n" "" "" 8testing "fractional seconds" "top -b -d 8.5 -n1 | tail -c 1" "\n" "" "" 9 10# These are unit tests of xparsetime. 11testing "-d invalid input" "top -b -d monkey -n1 2>&1 >/dev/null" "top: Not a number 'monkey'\n" "" "" 12testing "-d unknown suffix" "top -b -d 1u -n1 2>&1 >/dev/null" "top: Unknown suffix 'u'\n" "" "" 13testing "-d suffix trailing junk" "top -b -d 1monkey -n1 2>&1 >/dev/null" "top: Unknown suffix 'monkey'\n" "" "" 14