xref: /freebsd/usr.bin/units/tests/basics_test.sh (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
1#!/bin/sh
2# $FreeBSD$
3
4base=`basename $0`
5
6echo "1..3"
7
8assert_equals() {
9    testnum="$1"
10    expected="$2"
11    fn="$3"
12    if [ "$expected" = "$($fn)" ]
13    then
14        echo "ok $testnum - $fn"
15    else
16        echo "not ok $testnum - $fn"
17    fi
18}
19
20assert_equals 1 1 "units -t ft ft"
21assert_equals 2 12 "units -t ft in"
22assert_equals 3 0.083333333 "units -t in ft"
23