-#!/bin/bash
+#!/bin/sh
# SUSv3 compliant sort tests.
# Copyright 2005 by Rob Landley <rob@landley.net>
-# Licensed under GPL v2, see file LICENSE for details.
+# Licensed under GPLv2, see file LICENSE in this source tree.
-. testing.sh
+. ./testing.sh
# The basic tests. These should work even with the small busybox.
999 3 0 algebra
"
+# testing "description" "command(s)" "result" "infile" "stdin"
+
# Sorting with keys
testing "sort one key" "sort -k4,4 input" \
testing "sort key doesn't strip leading blanks, disables fallback global sort" \
"sort -n -k2 -t ' '" " a \n 1 \n 2 \n" "" " 2 \n 1 \n a \n"
+testing "sort file in place" \
+"sort -o input input && cat input" "\
+111
+222
+" "\
+222
+111
+" ""
+
+# testing "description" "command(s)" "result" "infile" "stdin"
+
exit $FAILCOUNT