Changeset 3613 in kBuild for trunk/src/sed/testsuite/distrib.sh
- Timestamp:
- Sep 19, 2024 12:34:43 AM (7 months ago)
- Location:
- trunk/src/sed
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sed
-
Property svn:mergeinfo
set to
/vendor/sed/current merged eligible
-
Property svn:mergeinfo
set to
-
trunk/src/sed/testsuite/distrib.sh
r599 r3613 1 #! /bin/sh 1 #!/bin/sh 2 3 # Test runner for the old 'distrib' test 4 5 # Copyright (C) 2017-2022 Free Software Foundation, Inc. 6 7 # This program is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 3 of the License, or 10 # (at your option) any later version. 11 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 17 # You should have received a copy of the GNU General Public License 18 # along with this program. If not, see <https://www.gnu.org/licenses/>. 19 . "${srcdir=.}/testsuite/init.sh"; path_prepend_ ./sed 20 print_ver_ sed 21 22 # This is straight out of C News 2 23 # 3 # This is stolen from C News4 #5 6 7 24 # 8 25 # All this does is massage the headers so they look like what news … … 21 38 # in a newsgroup that bears this stamp will not be fed into the 22 39 # matching mailing list. 23 24 sed=${1-sed} 25 26 $sed -n -e "1{i\\ 40 cat << \EOF > distrib.sed || framework_failure_ 41 1i\ 27 42 Path: mailnewsgateway 28 }" \ 29 -e ":a 43 :a 30 44 /^[Rr]eceived:/b r 31 45 /^[Nn]ewsgroups:/b r … … 37 51 s/^[Ii]n-[Rr]eply-[Tt]o:/References:/ 38 52 /^From:/{ 39 s/<\([^@]*\)> \$/<\1@$thissite>/40 s/^From:[ ][ ]*\(.*\) *<\(.*\)> \$/From: \2 (\1)/53 s/<\([^@]*\)>$/<\1@$thissite>/ 54 s/^From:[ ][ ]*\(.*\) *<\(.*\)>$/From: \2 (\1)/ 41 55 } 42 56 s/-[Ii]d:/-ID:/ 43 57 s/^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]:[ ]*$/Subject: (none)/ 44 58 s/^\([^:]*:\)[ ]*/\1 / 45 /^ \$/{i\\46 Newsgroups: alt.buddha.short.fat.guy\ \47 Distribution: world\ \48 Sender: [email protected]\ \59 /^$/{i\ 60 Newsgroups: alt.buddha.short.fat.guy\ 61 Distribution: world\ 62 Sender: [email protected]\ 49 63 Approved: [email protected] 50 64 b e … … 61 75 p 62 76 n 63 b e" 77 b e 78 EOF 79 80 81 # The expected output 82 cat << \EOF > distrib-exp || framework_failure_ 83 Path: mailnewsgateway 84 From [email protected] Wed Mar 8 18: 02:42 1995 85 From: [email protected] (Jason Molenda) 86 Message-ID: <[email protected]> 87 Subject: Note for sed testsuite 88 Original-To: [email protected] 89 Date: Wed, 8 Mar 1995 18:02:24 -0800 (PST) 90 X-Mailer: ELM [version 2.4 PL23] 91 Newsgroups: alt.buddha.short.fat.guy 92 Distribution: world 93 Sender: [email protected] 94 Approved: [email protected] 95 96 _Summum Bonum_ 97 98 All the breath and the bloom of the 99 year in the bag of one bee: 100 All the wonder and wealth of the mine in 101 the heart of one gem: 102 In the core of one pearl all the shade and the 103 shine of the sea: 104 Breath and bloom, shade and shine, -- wonder, 105 wealth, and -- how far above them -- 106 Truth, thats brighter than gem, 107 Trust, that's purer than pearl, -- 108 Brightest truth, purest trust in the universe -- 109 all were for me 110 In the kiss of one girl. 111 -- Robert Browning 112 EOF 113 114 # NOTE: 115 # The input has lines wider than 80 characters, and is kept as a separate file. 116 117 # location of external test files 118 dir="$abs_top_srcdir/testsuite" 119 120 121 sed -n -f distrib.sed < "$dir/distrib.inp" > distrib-out || fail=1 122 remove_cr_inplace distrib-out 123 compare distrib-exp distrib-out || fail=1 124 125 126 Exit $fail
Note:
See TracChangeset
for help on using the changeset viewer.