summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-08-15 09:48:43 +0200
committerJim Meyering <meyering@redhat.com>2008-08-15 10:18:51 +0200
commit929479026b3fd5910c165c22e1fae9f02e773342 (patch)
tree738dd6b61eded668cd30ba4b1636d3b9ba8cb96b /tests
parent4c9fae4e97d95a9f89d1399a8aeb03051f0fec96 (diff)
downloadcoreutils-929479026b3fd5910c165c22e1fae9f02e773342.tar.xz
adjust
Diffstat (limited to 'tests')
-rwxr-xr-x[-rw-r--r--]tests/misc/sort-version36
1 files changed, 23 insertions, 13 deletions
diff --git a/tests/misc/sort-version b/tests/misc/sort-version
index a4ebd400f..3208f2eea 100644..100755
--- a/tests/misc/sort-version
+++ b/tests/misc/sort-version
@@ -1,18 +1,29 @@
-#!/usr/bin/echo do-not-run-this-directly.-Use-a-shell
-# -*- Mode: shell-script -*-
+#!/bin/sh
+# exercise sort's --sort=version option
+
+# Copyright (C) 2008 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
if test "$VERBOSE" = yes; then
set -x
sort --version
fi
-. $top_srcdir/tests/test-lib.sh
-
-s_file=sort-ver-src
-g_file=sort-ver-good
-r_file=sort-ver-res
+. $srcdir/test-lib.sh
-cat > $s_file <<- _EOF_
+cat > in <<- _EOF_
string start 5.0.0 end of str
string start 5.00.0 end of str
string start 5.1.0 end of str
@@ -35,8 +46,7 @@ cat > $s_file <<- _EOF_
string start 5.90.0 end of str
_EOF_
-
-cat > $g_file <<- _EOF_
+cat > exp <<- _EOF_
string start 5.00.0 end of str
string start 5.0.0 end of str
string start 5.1.0 end of str
@@ -60,6 +70,6 @@ cat > $g_file <<- _EOF_
_EOF_
fail=0
-sort --sort=version -o $r_file $s_file
-compare $g_file $r_file >/dev/null 2>&1 || fail=1
-(exit $fail) ; exit $fail
+sort --sort=version -o out in || fail=1
+compare exp out || fail=1
+(exit $fail); exit $fail