annotate tests/test-xstrtoumax.sh @ 17632:86af85d364e1 default tip

unistd: port readlink to Mac OS X 10.3.9 * lib/unistd.in.h (_GL_INCLUDING_UNISTD_H): New macro, to work around self-include problem in Mac OS X 10.3.9 when combined with readlink module. Problem reported by Klaus Zietler in <http://bugs.gnu.org/16825>.
author Paul Eggert <eggert@penguin.cs.ucla.edu>
date Tue, 25 Feb 2014 11:16:27 -0800
parents f9b906545e2f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
1 #!/bin/sh
13174
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
2 : ${srcdir=.}
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
3 . "$srcdir/init.sh"; path_prepend_ .
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
4
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
5 too_big=99999999999999999999999999999999999999999999999999999999999999999999
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
6 result=0
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
7
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
8 # test xstrtoumax
13174
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
9 test-xstrtoumax 1 >> out 2>&1 || result=1
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
10 test-xstrtoumax -1 >> out 2>&1 && result=1
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
11 test-xstrtoumax 1k >> out 2>&1 || result=1
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
12 test-xstrtoumax ${too_big}h >> out 2>&1 && result=1
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
13 test-xstrtoumax $too_big >> out 2>&1 && result=1
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
14 test-xstrtoumax x >> out 2>&1 && result=1
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
15 test-xstrtoumax 9x >> out 2>&1 && result=1
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
16 test-xstrtoumax 010 >> out 2>&1 || result=1
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
17 test-xstrtoumax MiB >> out 2>&1 || result=1
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
18
9975
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
19 # Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
20 # does not understand '\r'.
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
21 if echo solaris | tr -d '\r' | grep solais > /dev/null; then
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
22 cr='\015'
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
23 else
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
24 cr='\r'
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
25 fi
44e4e306d7c5 Work around limitation of an old 'tr' program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 9958
diff changeset
26
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
27 # normalize output
13174
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
28 LC_ALL=C tr -d "$cr" < out > k
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
29 mv k out
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
30
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
31 # compare expected output
13174
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
32 cat > exp <<EOF
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
33 1->1 ()
16234
f9b906545e2f Use ', not `, for quoting output.
Paul Eggert <eggert@cs.ucla.edu>
parents: 13174
diff changeset
34 invalid X argument '-1'
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
35 1k->1024 ()
16234
f9b906545e2f Use ', not `, for quoting output.
Paul Eggert <eggert@cs.ucla.edu>
parents: 13174
diff changeset
36 invalid suffix in X argument '${too_big}h'
f9b906545e2f Use ', not `, for quoting output.
Paul Eggert <eggert@cs.ucla.edu>
parents: 13174
diff changeset
37 X argument '$too_big' too large
f9b906545e2f Use ', not `, for quoting output.
Paul Eggert <eggert@cs.ucla.edu>
parents: 13174
diff changeset
38 invalid X argument 'x'
f9b906545e2f Use ', not `, for quoting output.
Paul Eggert <eggert@cs.ucla.edu>
parents: 13174
diff changeset
39 invalid suffix in X argument '9x'
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
40 010->8 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
41 MiB->1048576 ()
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
42 EOF
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
43
13174
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
44 compare exp out || result=1
9141
2f9763090486 Move xstrtol messages into gnulib domain, when --pobase is used.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
45
13174
371266bf04b6 xstrtoumax-tests: convert to use init.sh
Jim Meyering <meyering@redhat.com>
parents: 9975
diff changeset
46 Exit $result