Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.86k stars 528 forks source link

no test cases for splice(@array) #1213

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#2196 (status was 'resolved')

Searchable as RT2196$

p5pRT commented 24 years ago

From dcd@tc.fluke.com

Created by dcd@tc.fluke.com

The current perldoc -f splice does not indicate that the OFFSET parameter to splice is optional.

I see in p5p that recent patches to the documentation seem to indicate that splice(@​array) is to be accepted.

perl v5.5.650 has no test cases for splice(@​array)\, and no examples that so that it should work;

Perl Info ``` Site configuration information for perl v5.5.650: Configured by dcd at Wed Feb 9 12:36:33 PST 2000. Summary of my perl5 (revision 5.0 version 5 subversion 650) configuration: Platform: osname=linux, osvers=2.3.40, archname=i686-linux uname='linux dd 2.3.40 #1 fri jan 21 12:06:36 pst 2000 i686 ' config_args='-Doptimize=-g -de -Dcf_email=dcd@tc.fluke.com' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usesocks=undef useperlio=undef d_sfio=undef use64bits=undef uselargefiles=define usemultiplicity=undef Compiler: cc='cc', optimize='-g', gccversion=2.7.2.3 cppflags='-Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include' ccflags ='-Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /shlib /lib /usr/lib libs=-lgdbm -ldbm -ldb -ldl -lm -lc libc=/lib/libc.so.5.4.44, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl v5.5.650: /usr/local/lib/perl5/5.5.650/i686-linux /usr/local/lib/perl5/5.5.650 /usr/local/lib/perl5/site_perl/5.5.650/i686-linux /usr/local/lib/perl5/site_perl/5.5.650 /usr/local/lib/perl5/site_perl . Environment for perl v5.5.650: HOME=/home/dcd LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/dcd/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/usr/local/samba:/home/hobbes/tools/scripts:/home/hobbes/tools/linux:/usr0/hobbes/tools/scripts:/usr0/dcd/bin:/apps/general/bin:/usr/public PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 23 years ago

From @floatingatoll

R.

Inline Patch ```diff --- t/op/splice.t.orig Mon Jul 31 19:32:14 2000 +++ t/op/splice.t Mon May 28 03:15:42 2001 @@ -1,6 +1,6 @@ #!./perl -print "1..9\n"; +print "1..10\n"; @a = (1..10); @@ -32,3 +32,7 @@ print "not " unless j(splice(@a,-3,-2,2)) eq j(7) && j(@a) eq ```

j(1,2,7,3); print "ok 9\n"; + +# Bug 20000223.001 - no test for splice(@​array). Destructive test! +print "not " unless j(splice(@​a)) eq j(1\,2\,7\,3) && j(@​a) eq ''; +print "ok 10\n";