VirtualBox

source: kBuild/vendor/grep/3.7/tests/encoding-error@ 3576

Last change on this file since 3576 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# Test grep's behavior on encoding errors.
3#
4# Copyright 2015-2021 Free Software Foundation, Inc.
5#
6# Copying and distribution of this file, with or without modification,
7# are permitted in any medium without royalty provided the copyright
8# notice and this notice are preserved.
9
10. "${srcdir=.}/init.sh"; path_prepend_ ../src
11
12require_en_utf8_locale_
13
14printf 'Alfred Jones\n' > a || framework_failure_
15printf 'John Smith\n' >j || framework_failure_
16printf 'Pedro P\351rez\n' >p || framework_failure_
17cat a p j >in || framework_failure_
18
19LC_ALL=en_US.UTF-8
20export LC_ALL
21
22fail=0
23
24grep '^A' in >out || fail=1
25compare a out || fail=1
26
27grep '^P' in >out || fail=1
28compare /dev/null out || fail=1
29
30grep -I '^P' in >out 2>err || fail=1
31compare /dev/null out || fail=1
32compare /dev/null err || fail=1
33
34grep '^J' in >out || fail=1
35compare j out || fail=1
36
37returns_ 1 grep '^X' in >out || fail=1
38compare /dev/null out || fail=1
39
40grep . in >out || fail=1
41cat a j >exp || framework_failure_
42compare exp out || fail=1
43
44grep -I . in >out 2>err || fail=1
45cat a j >exp || framework_failure_
46compare exp out || fail=1
47compare /dev/null err || fail=1
48
49grep -a . in >out || fail=1
50compare in out
51
52Exit $fail
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