apk-tools/test/version.sh
Timo Teräs 3df4a948a6 version: fix leading zero stripping
Only the leading zeroes should be ignored. Handle properly if the
version component is actually zero.

fixes #10880
2023-02-28 14:39:09 +02:00

19 lines
342 B
Bash
Executable file

#!/bin/sh
fail=0
while read a result b rest ; do
output="$(../src/apk version -t "$a" "$b")"
if [ "$output" != "$result" ] ; then
echo "$a $result $b, but got $output"
fail=$((fail+1))
fi
done < version.data
if [ "$fail" = "0" ]; then
echo "OK: version checking works"
else
echo "FAIL: $fail version checks failed"
fi
exit $fail