VirtualBox

source: kBuild/trunk/src/sed/testsuite/cmd-R.sh@ 3613

Last change on this file since 3613 was 3613, checked in by bird, 7 months ago

src/sed: Merged in changes between 4.1.5 and 4.9 from the vendor branch. (svn merge /vendor/sed/4.1.5 /vendor/sed/current .)

File size: 1.6 KB
Line 
1#!/bin/sh
2# Test 'R' command
3
4# Copyright (C) 2016-2022 Free Software Foundation, Inc.
5
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <https://www.gnu.org/licenses/>.
18. "${srcdir=.}/testsuite/init.sh"; path_prepend_ ./sed
19print_ver_ sed
20
21printf "%s\n" x y > a || framework_failure_
22printf "%s\n" 1 2 > b || framework_failure_
23printf "%s\n" X > c || framework_failure_
24touch d || framework_failure_
25
26# Read and interleave two lines
27printf "%s\n" x 1 y 2 > exp1 || framework_failure_
28sed -e 1Rb -e 2Rb a > out1 || fail=1
29compare_ exp1 out1 || fail=1
30
31# Read a non-existing file, silently ignored
32sed -e 1Rq a > out2 || fail=1
33compare_ a out2
34
35# Read two lines from a file, second time will be EOF
36# (implementation note: EOF from get_delim())
37printf "%s\n" x X y > exp3 || framework_failure_
38sed -e 1Rc -e 2Rc a > out3 || fail=1
39compare_ exp3 out3 || fail=1
40
41# Read two lines from an empty file, both will be EOF
42# (implementation note: EOF in before get_delim())
43sed -e 1Rd -e 2Rd a > out4 || fail=1
44compare_ a out4 || fail=1
45
46
47Exit $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