ifupdown: save some 100+ bytes of code in addstr()
[oweals/busybox.git] / testsuite / sort.tests
index d1b42532da518d5fe90a23624014c6168616c34f..5a4937b5818c36a8494c2f73740641a0bae17d2d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # SUSv3 compliant sort tests.
 # Copyright 2005 by Rob Landley <rob@landley.net>
@@ -56,7 +56,7 @@ testing "sort key range with numeric option and global reverse" \
 7      3       42      soup
 " "$data" ""
 
-# 
+#
 
 testing "sort key range with multiple options" "sort -k2,3rn input" \
 "7     3       42      soup
@@ -66,4 +66,18 @@ testing "sort key range with multiple options" "sort -k2,3rn input" \
 egg    1       2       papyrus
 " "$data" ""
 
+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 key edge case with -t" "sort -n -k4 -t/" \
+"/usr/lib/finish-install.d/1
+/usr/lib/finish-install.d/4
+/usr/lib/prebaseconfig.d/2
+/usr/lib/prebaseconfig.d/6
+" "" "/usr/lib/finish-install.d/1
+/usr/lib/prebaseconfig.d/2
+/usr/lib/finish-install.d/4
+/usr/lib/prebaseconfig.d/6
+"
+
 exit $FAILCOUNT