From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27588 invoked from network); 26 Mar 2003 17:20:36 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Mar 2003 17:20:36 -0000 Received: (qmail 22472 invoked by alias); 26 Mar 2003 17:20:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18391 Received: (qmail 22461 invoked from network); 26 Mar 2003 17:20:29 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 26 Mar 2003 17:20:29 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [212.125.75.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 26 Mar 2003 17:20:29 -0000 Received: (qmail 20816 invoked from network); 26 Mar 2003 17:20:26 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-18.tower-1.messagelabs.com with SMTP; 26 Mar 2003 17:20:26 -0000 Received: from finches.logica.co.uk ([158.234.142.11]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id RAA06148 for ; Wed, 26 Mar 2003 17:20:25 GMT X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk Received: from finches.logica.co.uk (localhost [127.0.0.1]) by finches.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h2QHOdK02863 for ; Wed, 26 Mar 2003 18:24:39 +0100 To: zsh-workers@sunsite.dk (Zsh hackers list) X-VirusChecked: Checked In-reply-to: <20706.1048688201@csr.com> From: Oliver Kiddle References: <20706.1048688201@csr.com> Subject: bug in read builtin and Re: PATCH: extra loop tests Date: Wed, 26 Mar 2003 18:24:39 +0100 Message-ID: <2861.1048699479@finches.logica.co.uk> Peter wrote: > Tests for the enhanced `for' syntax as well as `select' which is now I've just added a few tests too. In adding tests for read (to cover the new read -d), I found that read -t 1 -p causes a seg fault: #0 0x080bb323 in read_poll (fd=-1, readchar=0xbffff0fc, polltty=0, microseconds=1000000) at utils.c:1398 #1 0x0805eec7 in bin_read (name=0x40020248 "read", args=0xbffff170, ops=0xbffff1b0, func=0) at builtin.c:4215 #2 0x08052545 in execbuiltin (args=0x40020210, bn=0x80cbab4) at builtin.c:440 > Extra tests gratefully received, as Felix reminded us, particularly for > interactive stuff (zle, completion) which I will not be attempting > myself. I've not attempted anything for interactive stuff either I'm afraid. I've also not done anything for \u or the math locale problem because it would be dependant on the local environment and the test system sets LANG=C anyway. > When we finally get the multiple defined limits problem fixed, I will > produce a test version of 4.1.1. If tests continue to trickle in, so > much the better. Also one of 17797 or 17820 should be committed before a release. I don't have access to cygwin so can't test 17820. There have been enough changes to warrant a 4.0.7 before too long. Any suggestions on stuff which can be merged back from 4.1? Oliver Index: Test/.distfiles =================================================================== RCS file: /cvsroot/zsh/zsh/Test/.distfiles,v retrieving revision 1.14 diff -u -r1.14 .distfiles --- Test/.distfiles 17 Dec 2001 17:17:38 -0000 1.14 +++ Test/.distfiles 26 Mar 2003 17:05:03 -0000 @@ -8,6 +8,6 @@ A04redirect.ztst D01prompt.ztst V02zregexparse.ztst A05execution.ztst D02glob.ztst Y01completion.ztst D06subscript.ztst V01zmodload.ztst E01options.ztst -B02typeset.ztst B03print.ztst A06assign.ztst +B02typeset.ztst B03print.ztst A06assign.ztst B04read.ztst README ' Index: Test/B03print.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/B03print.ztst,v retrieving revision 1.5 diff -u -r1.5 B03print.ztst --- Test/B03print.ztst 27 Aug 2002 21:11:44 -0000 1.5 +++ Test/B03print.ztst 26 Mar 2003 17:05:03 -0000 @@ -199,3 +199,7 @@ 0:argument specified for precision only >2 >000 + + printf -- '%s\n' str +0:initial `--' ignored to satisfy POSIX +>str Index: Test/B04read.ztst =================================================================== RCS file: Test/B04read.ztst diff -N Test/B04read.ztst --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Test/B04read.ztst 26 Mar 2003 17:05:03 -0000 @@ -0,0 +1,65 @@ +# Tests for the read builtin + +# Tested elsewhere: +# reading from a coprocess A01grammar, A04redirect + +# Not tested: +# -c/-l/-n (options for compctl functions) +# -q/-s (needs a tty) + +%test + + read <<<'hello world' + print $REPLY +0:basic read command +>hello world + + read -A <<<'hello world' + print $reply[2] +0:array read +>world + + read -k3 -u0 <<foo + + read -d: <<foo + + print foo:bar|IFS=: read -A + print $reply +0:use different, IFS separator to array +>foo bar + + print -z hello world; read -z + print $REPLY +0:read from editor buffer stack +>hello world + + unset REPLY + read -E <<hello +>hello + + unset REPLY + read -e <<hello +> + + read -e -t <<hello + + SECONDS=0 + read -e -t 5 <<hello +>0 Index: Test/C01arith.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/C01arith.ztst,v retrieving revision 1.5 diff -u -r1.5 C01arith.ztst --- Test/C01arith.ztst 23 Jan 2002 16:28:17 -0000 1.5 +++ Test/C01arith.ztst 26 Mar 2003 17:05:03 -0000 @@ -98,3 +98,7 @@ print $x 0:assigning to scalar which contains non-math string >32 + + print $(( )) +0:empty math parse e.g. $(( )) acts like a zero +>0 Index: Test/D02glob.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/D02glob.ztst,v retrieving revision 1.1 diff -u -r1.1 D02glob.ztst --- Test/D02glob.ztst 2 Apr 2001 12:33:33 -0000 1.1 +++ Test/D02glob.ztst 26 Mar 2003 17:05:03 -0000 @@ -16,7 +16,7 @@ setopt nonullglob nomatch print glob.tmp/**/*~(.)# } - + %test globtest globtests @@ -265,3 +265,28 @@ 0:exclusions regression test > >glob.tmp/a glob.tmp/b glob.tmp/c glob.tmp/dir1 glob.tmp/dir1/a glob.tmp/dir1/b glob.tmp/dir1/c glob.tmp/dir2 glob.tmp/dir2/a glob.tmp/dir2/b glob.tmp/dir2/c + + print glob.tmp/*(/) +0:Just directories +>glob.tmp/dir1 glob.tmp/dir2 + + print glob.tmp/*(.) +0:Just files +>glob.tmp/a glob.tmp/b glob.tmp/c + + print glob.tmp/*(.e^'reply=( glob.tmp/*/${REPLY:t} )'^:t) +0:Globbing used recursively (inside e glob qualifier) +>a a b b c c + + print glob.tmp/**/(:h) +0:Head modifier +>. glob.tmp glob.tmp + + print glob.tmp(:r) +0:Remove extension modifier +>glob + + print glob.tmp/*(:s/./_/) +0:Substitute modifier +>glob_tmp/a glob_tmp/b glob_tmp/c glob_tmp/dir1 glob_tmp/dir2 +