VirtualBox

source: kBuild/trunk/src/grep/gnulib-tests/test-xstrtoimax.sh@ 3532

Last change on this file since 3532 was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/sh
2: ${srcdir=.}
3. "$srcdir/init.sh"; path_prepend_ .
4
5too_big=99999999999999999999999999999999999999999999999999999999999999999999
6result=0
7
8# test xstrtoimax
9${CHECKER} test-xstrtoimax 1 >> out 2>&1 || result=1
10${CHECKER} test-xstrtoimax -1 >> out 2>&1 || result=1
11${CHECKER} test-xstrtoimax 1k >> out 2>&1 || result=1
12${CHECKER} test-xstrtoimax ${too_big}h >> out 2>&1 && result=1
13${CHECKER} test-xstrtoimax $too_big >> out 2>&1 && result=1
14${CHECKER} test-xstrtoimax x >> out 2>&1 && result=1
15${CHECKER} test-xstrtoimax 9x >> out 2>&1 && result=1
16${CHECKER} test-xstrtoimax 010 >> out 2>&1 || result=1
17${CHECKER} test-xstrtoimax MiB >> out 2>&1 || result=1
18
19# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
20# does not understand '\r'.
21if echo solaris | tr -d '\r' | grep solais > /dev/null; then
22 cr='\015'
23else
24 cr='\r'
25fi
26
27# normalize output
28LC_ALL=C tr -d "$cr" < out > k
29mv k out
30
31# compare expected output
32cat > exp <<EOF
331->1 ()
34-1->-1 ()
351k->1024 ()
36invalid suffix in X argument '${too_big}h'
37X argument '$too_big' too large
38invalid X argument 'x'
39invalid suffix in X argument '9x'
40010->8 ()
41MiB->1048576 ()
42EOF
43
44compare exp out || result=1
45
46Exit $result
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette