VirtualBox

source: kBuild/vendor/grep/current/tests/pcre-context@ 3630

Last change on this file since 3630 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: 568 bytes
Line 
1#!/bin/sh
2# Test Perl regex with context
3. "${srcdir=.}/init.sh"; path_prepend_ ../src
4require_pcre_
5
6cat >in <<'EOF'
7Preceded by 0 empty lines.
8
9Preceded by 1 empty line.
10
11
12Preceded by 2 empty lines.
13
14
15
16Preceded by 3 empty lines.
17
18
19
20
21Preceded by 4 empty lines.
22
23EOF
24test $? -eq 0 || framework_failure_
25
26printf '%s\0' \
27 'Preceded by 2 empty lines.' \
28 'Preceded by 3 empty lines.' \
29 'Preceded by 4 empty lines.' >exp || framework_failure_
30
31fail=0
32
33grep -Pzo '(?<=\n\n\n).*' in >out || fail_ 'grep -Pzo failed'
34compare exp out || fail=1
35
36Exit $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