diff --git a/unittest b/unittest
index f3c2f0e..1b6371f 100755
--- a/unittest
+++ b/unittest
@@ -261,7 +261,7 @@ dir=$(mktemp -d)
file=$(mktemp --tmpdir="$dir")
declare -A types=(
[link]="$dir/link1 $dir/link2"
- [file]="$file ${types[link]}"
+ [file]="$file $dir/link1"
[directory]=". .. $dir $dir/linkdir"
[char]="c . 0 @"
[unsignedint]=123
@@ -269,7 +269,6 @@ declare -A types=(
[hexa]="0x123abc 71234 abc"
[ipv4]="192.168.40.254 127.0.0.1 1.2.3.4"
[ipv6]="2001:7a8:b018::1 ::1 2001:7a8:b018:0:21f:c6ff:fe59:71fd"
- [host]="${types[ipv4]} ${types[ipv6]}"
[username]=$(whoami)
[group]=$(id -gn)
[port]="ssh 80"
@@ -307,6 +306,8 @@ do
fi
done
+# Default 'host' type test case:
+types[host]="${types[ipv4]} ${types[ipv6]}"
# Test hostnames only if we can actually resolv.
if host localhost >/dev/null 2>&1
then
@@ -318,6 +319,7 @@ else
fi
(cd "$dir" && ln -s "$file" link1 && ln -s asdf link2 && ln -s . linkdir)
+
for type in "${!types[@]}"
do
(
@@ -337,7 +339,7 @@ declare -A bad_types=(
[directory]="${types[file]} $fifo $dir/link1"
[pipe]="${types[file]} ${types[dir]}"
[socket]="${types[file]} $fifo $dir/link1"
- [link]="${types[file]} $fifo"
+ [link]="$file $fifo"
[char]="12 abc"
[unsignedint]="-1 -2234958 abc"
[int]="a b casdf"