VirtualBox

Changeset 3613 in kBuild for trunk/src/sed/testsuite/distrib.sh


Ignore:
Timestamp:
Sep 19, 2024 12:34:43 AM (7 months ago)
Author:
bird
Message:

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 .)

Location:
trunk/src/sed
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sed

  • 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
     20print_ver_ sed
     21
     22#   This is straight out of C News
    223#
    3 #   This is stolen from C News
    4 #
    5 
    6 
    724#
    825# All this does is massage the headers so they look like what news
     
    2138# in a newsgroup that bears this stamp will not be fed into the
    2239# matching mailing list.
    23 
    24 sed=${1-sed}
    25 
    26 $sed -n -e "1{i\\
     40cat << \EOF > distrib.sed || framework_failure_
     411i\
    2742Path: mailnewsgateway
    28         }" \
    29     -e ":a
     43        :a
    3044        /^[Rr]eceived:/b r
    3145        /^[Nn]ewsgroups:/b r
     
    3751        s/^[Ii]n-[Rr]eply-[Tt]o:/References:/
    3852        /^From:/{
    39                 s/<\([^@]*\)>\$/<\1@$thissite>/
    40                 s/^From:[       ][      ]*\(.*\)  *<\(.*\)>\$/From: \2 (\1)/
     53                s/<\([^@]*\)>$/<\1@$thissite>/
     54                s/^From:[       ][      ]*\(.*\)  *<\(.*\)>$/From: \2 (\1)/
    4155                }
    4256        s/-[Ii]d:/-ID:/
    4357        s/^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]:[       ]*$/Subject: (none)/
    4458        s/^\([^:]*:\)[   ]*/\1 /
    45         /^\$/{i\\
    46 Newsgroups: alt.buddha.short.fat.guy\\
    47 Distribution: world\\
    48 Sender: [email protected]\\
     59        /^$/{i\
     60Newsgroups: alt.buddha.short.fat.guy\
     61Distribution: world\
     62Sender: [email protected]\
    4963Approved: [email protected]
    5064        b e
     
    6175        p
    6276        n
    63         b e"
     77        b e
     78EOF
     79
     80
     81# The expected output
     82cat << \EOF > distrib-exp || framework_failure_
     83Path: mailnewsgateway
     84From [email protected]  Wed Mar  8 18: 02:42 1995
     85From: [email protected] (Jason Molenda)
     86Message-ID: <[email protected]>
     87Subject: Note for sed testsuite
     88Original-To: [email protected]
     89Date: Wed, 8 Mar 1995 18:02:24 -0800 (PST)
     90X-Mailer: ELM [version 2.4 PL23]
     91Newsgroups: alt.buddha.short.fat.guy
     92Distribution: world
     93Sender: [email protected]
     94Approved: [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
     112EOF
     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
     118dir="$abs_top_srcdir/testsuite"
     119
     120
     121sed -n -f distrib.sed < "$dir/distrib.inp" > distrib-out || fail=1
     122remove_cr_inplace distrib-out
     123compare distrib-exp distrib-out || fail=1
     124
     125
     126Exit $fail
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette