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