VirtualBox

source: kBuild/trunk/src/sed/testsuite/binary.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 .)

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/sh
2
3# Test runner for the binary-operation version of dc.sed.
4# Adapted from old-style 'binary.sed' test.
5
6# Copyright (C) 2017-2022 Free Software Foundation, Inc.
7
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <https://www.gnu.org/licenses/>.
20. "${srcdir=.}/testsuite/init.sh"; path_prepend_ ./sed
21print_ver_ sed
22
23cat << \EOF > inp || framework_failure_
24192.168.1.2 br b8<r b16<r b24< R|R|R| D
25255.255.255.0 br b8<r b16<r b24< R|R|R| D~r
26& DDD 24>dpP 16>11111111& dpP 8>11111111& dpP 11111111& dpP
27| DDD 24>dpP 16>11111111& dpP 8>11111111& dpP 11111111& dpP
28EOF
29
30
31cat << \EOF > exp || framework_failure_
32192
33168
341
350
36192
37168
381
39255
40EOF
41
42
43# location of the external SED scripts
44dir="$abs_top_srcdir/testsuite"
45
46
47# Run the three variations of the sed script
48sed -n -f "$dir/binary.sed" < inp > out1 || fail=1
49remove_cr_inplace out1
50compare exp out1 || fail=1
51
52sed -n -f "$dir/binary2.sed" < inp > out2 || fail=1
53remove_cr_inplace out2
54compare exp out2 || fail=1
55
56sed -n -f "$dir/binary3.sed" < inp > out3 || fail=1
57remove_cr_inplace out3
58compare exp out3 || fail=1
59
60
61Exit $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