aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/units/tests/basics_test.sh
blob: adc28e031fa93d15af8762f85721f1c9394c006d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# $FreeBSD$

base=`basename $0`

echo "1..3"

assert_equals() {
    testnum="$1"
    expected="$2"
    fn="$3"
    if [ "$expected" = "$($fn)" ]
    then
        echo "ok $testnum - $fn"
    else
        echo "not ok $testnum - $fn"
    fi
}

assert_equals 1 1 "units -t ft ft"
assert_equals 2 12 "units -t ft in"
assert_equals 3 0.083333333 "units -t in ft"