From 760ac839baf413929cd31cc32ffd6dba6b781a81 Mon Sep 17 00:00:00 2001 From: Larry Wall Date: Sat, 10 Aug 1996 15:24:58 +0000 Subject: perl 5.003_02: [no incremental changelog available] --- os2/OS2/PrfDB/t/os2_prfdb.t | 185 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 os2/OS2/PrfDB/t/os2_prfdb.t (limited to 'os2/OS2/PrfDB/t') diff --git a/os2/OS2/PrfDB/t/os2_prfdb.t b/os2/OS2/PrfDB/t/os2_prfdb.t new file mode 100644 index 0000000000..4c0883db50 --- /dev/null +++ b/os2/OS2/PrfDB/t/os2_prfdb.t @@ -0,0 +1,185 @@ +BEGIN { + chdir 't' if -d 't/lib'; + @INC = '../lib' if -d 'lib'; + require Config; import Config; + if (-d 'lib' and $Config{'extensions'} !~ /\bOS2::PrfDB\b/) { + print "1..0\n"; + exit 0; + } +} + +# Before `make install' is performed this script should be runnable with +# `make test'. After `make install' it should work as `perl test.pl' + +######################### We start with some black magic to print on failure. + +# Change 1..1 below to 1..last_test_to_print . +# (It may become useful if the test is moved to ./t subdirectory.) + +BEGIN { $| = 1; print "1..48\n"; } +END {print "not ok 1\n" unless $loaded;} +use OS2::PrfDB; +$loaded = 1; +use strict; + +print "ok 1\n"; + +######################### End of black magic. + +# Insert your test code below (better if it prints "ok 13" +# (correspondingly "not ok 13") depending on the success of chunk 13 +# of the test code): + +my $inifile = "my.ini"; + +unlink $inifile if -w $inifile; + +my $ini = OS2::Prf::Open($inifile); +print( ($ini ? "": "not "), "ok 2\n# HINI=`$ini'\n"); + +print( (OS2::Prf::GetLength($ini,'aaa', 'bbb') != -1) ? + "not ok 3\n# err: `$^E'\n" : "ok 3\n"); + + +print( OS2::Prf::Set($ini,'aaa', 'bbb','xyz') ? "ok 4\n" : + "not ok 4\n# err: `$^E'\n"); + +my $len = OS2::Prf::GetLength($ini,'aaa', 'bbb'); +print( $len == 3 ? "ok 5\n" : "not ok 5# len: `$len' err: `$^E'\n"); + +my $val = OS2::Prf::Get($ini,'aaa', 'bbb'); +print( $val eq 'xyz' ? "ok 6\n" : "not ok 6# val: `$val' err: `$^E'\n"); + +$val = OS2::Prf::Get($ini,'aaa', undef); +print( $val eq "bbb\0" ? "ok 7\n" : "not ok 7# val: `$val' err: `$^E'\n"); + +$val = OS2::Prf::Get($ini, undef, undef); +print( $val eq "aaa\0" ? "ok 8\n" : "not ok 8# val: `$val' err: `$^E'\n"); + +my $res = OS2::Prf::Set($ini,'aaa', 'bbb',undef); +print( $res ? "ok 9\n" : "not ok 9# err: `$^E'\n"); + +$val = OS2::Prf::Get($ini, undef, undef); +print( (! defined $val) ? "ok 10\n" : "not ok 10# val: `$val' err: `$^E'\n"); + +$val = OS2::Prf::Get($ini,'aaa', undef); +print( (! defined $val) ? "ok 11\n" : "not ok 11# val: `$val' err: `$^E'\n"); + +print((OS2::Prf::Close($ini) ? "" : "not ") . "ok 12\n"); + +my $files = OS2::Prf::Profiles(); +print( (defined $files) ? "ok 13\n" : "not ok 13# err: `$^E'\n"); +print( (@$files == 2) ? "ok 14\n" : "not ok 14# `@$files' err: `$^E'\n"); +print "# `@$files'\n"; + +$ini = OS2::Prf::Open($inifile); +print( ($ini ? "": "not "), "ok 15\n# HINI=`$ini'\n"); + + +print( OS2::Prf::Set($ini,'aaa', 'ccc','xyz') ? "ok 16\n" : + "not ok 16\n# err: `$^E'\n"); + +print( OS2::Prf::Set($ini,'aaa', 'ddd','123') ? "ok 17\n" : + "not ok 17\n# err: `$^E'\n"); + +print( OS2::Prf::Set($ini,'bbb', 'xxx','abc') ? "ok 18\n" : + "not ok 18\n# err: `$^E'\n"); + +print( OS2::Prf::Set($ini,'bbb', 'yyy','456') ? "ok 19\n" : + "not ok 19\n# err: `$^E'\n"); + +my %hash1; + +tie %hash1, 'OS2::PrfDB::Sub', $inifile, 'aaa'; +$OS2::PrfDB::Sub::debug = 1; +print "ok 20\n"; + +my @a1 = keys %hash1; +print (@a1 == 2 ? "ok 21\n" : "not ok 21\n# `@a1'\n"); + +my @a2 = sort @a1; +print ("@a2" eq "ccc ddd" ? "ok 22\n" : "not ok 22\n# `@a2'\n"); + +$val = $hash1{ccc}; +print ($val eq "xyz" ? "ok 23\n" : "not ok 23\n# `$val'\n"); + +$val = $hash1{ddd}; +print ($val eq "123" ? "ok 24\n" : "not ok 24\n# `$val'\n"); + +print (exists $hash1{ccc} ? "ok 25\n" : "not ok 25\n# `$val'\n"); + +print (!exists $hash1{hhh} ? "ok 26\n" : "not ok 26\n# `$val'\n"); + +$hash1{hhh} = 12; +print (exists $hash1{hhh} ? "ok 27\n" : "not ok 27\n# `$val'\n"); + +$val = $hash1{hhh}; +print ($val eq "12" ? "ok 28\n" : "not ok 28\n# `$val'\n"); + +delete $hash1{ccc}; + +untie %hash1; +print "ok 29\n"; + +tie %hash1, 'OS2::PrfDB::Sub', $inifile, 'aaa'; +print "ok 30\n"; + +@a1 = keys %hash1; +print (@a1 == 2 ? "ok 31\n" : "not ok 31\n# `@a1'\n"); + +@a2 = sort @a1; +print ("@a2" eq "ddd hhh" ? "ok 32\n" : "not ok 32\n# `@a2'\n"); + +print (exists $hash1{hhh} ? "ok 33\n" : "not ok 33\n# `$val'\n"); + +$val = $hash1{hhh}; +print ($val eq "12" ? "ok 34\n" : "not ok 34\n# `$val'\n"); + +%hash1 = (); +print "ok 35\n"; + +%hash1 = ( hhh => 12, ddd => 5); + +untie %hash1; + +my %hash; + +tie %hash, 'OS2::PrfDB', $inifile; +print "ok 36\n"; + +@a1 = keys %hash; +print (@a1 == 2 ? "ok 37\n" : "not ok 37\n# `@a1'\n"); + +@a2 = sort @a1; +print ("@a2" eq "aaa bbb" ? "ok 38\n" : "not ok 38\n# `@a2'\n"); + +print (exists $hash{aaa} ? "ok 39\n" : "not ok 39\n# `$val'\n"); + +$val = $hash{aaa}; +print (ref $val eq "HASH" ? "ok 40\n" : "not ok 40\n# `$val'\n"); + +%hash1 = %$val; +print "ok 41\n"; + +@a1 = keys %hash1; +print (@a1 == 2 ? "ok 42\n" : "not ok 31\n# `@a1'\n"); + +@a2 = sort @a1; +print ("@a2" eq "ddd hhh" ? "ok 43\n" : "not ok 43\n# `@a2'\n"); + +print (exists $hash1{hhh} ? "ok 44\n" : "not ok 44\n# `$val'\n"); + +$val = $hash1{hhh}; +print ($val eq "12" ? "ok 45\n" : "not ok 45\n# `$val'\n"); + +$hash{nnn}{mmm} = 67; +print "ok 46\n"; + +untie %hash; + +my %hash2; + +tie %hash2, 'OS2::PrfDB', $inifile; +print "ok 47\n"; + +print ($hash2{nnn}->{mmm} eq "67" ? "ok 48\n" : "not ok 48\n# `$val'\n"); -- cgit v1.2.1 From bbad36071d5a6d4be3588f0f10c88247439076d8 Mon Sep 17 00:00:00 2001 From: Ilya Zakharevich Date: Thu, 16 Jan 1997 23:48:18 -0500 Subject: Test patches for OS/2 a) Teaches tests in os2/OS2/*/* new format of $Config{extensions}; os2/OS2/ExtAttr/t/os2_ea.t os2/OS2/PrfDB/t/os2_prfdb.t os2/OS2/REXX/t/rx_cmprt.t os2/OS2/REXX/t/rx_dllld.t os2/OS2/REXX/t/rx_objcall.t os2/OS2/REXX/t/rx_sql.test os2/OS2/REXX/t/rx_tiesql.test os2/OS2/REXX/t/rx_tievar.t os2/OS2/REXX/t/rx_tieydb.t os2/OS2/REXX/t/rx_varset.t os2/OS2/REXX/t/rx_vrexx.t b) Closes all the files before unlinking - for DOSISH systems; t/cmd/while.t t/comp/multiline.t t/io/argv.t t/lib/anydbm.t t/lib/gdbm.t t/lib/ndbm.t t/lib/odbm.t t/lib/sdbm.t c) t/README mentions running `harness' to get better granularity; t/README d) New test op/lex_assign.t added - will check optimization of lexicals when applied - 153 cases (some just ignored since hard to implement). MANIFEST t/op/lex_assign.t e) When a script is started via shell, $Config{exe_ext} may be appended. t/op/magic.t f) path/echo may print a warning if run without args t/comp/colon.t g) Error explanations more verbose t/op/cmp.t t/op/magic.t p5p-msgid: <199701170448.XAA28948@monk.mps.ohio-state.edu> --- os2/OS2/PrfDB/t/os2_prfdb.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'os2/OS2/PrfDB/t') diff --git a/os2/OS2/PrfDB/t/os2_prfdb.t b/os2/OS2/PrfDB/t/os2_prfdb.t index 4c0883db50..a8c9752d36 100644 --- a/os2/OS2/PrfDB/t/os2_prfdb.t +++ b/os2/OS2/PrfDB/t/os2_prfdb.t @@ -2,7 +2,7 @@ BEGIN { chdir 't' if -d 't/lib'; @INC = '../lib' if -d 'lib'; require Config; import Config; - if (-d 'lib' and $Config{'extensions'} !~ /\bOS2::PrfDB\b/) { + if (-d 'lib' and $Config{'extensions'} !~ /\bOS2(::|\/)PrfDB\b/) { print "1..0\n"; exit 0; } @@ -183,3 +183,6 @@ tie %hash2, 'OS2::PrfDB', $inifile; print "ok 47\n"; print ($hash2{nnn}->{mmm} eq "67" ? "ok 48\n" : "not ok 48\n# `$val'\n"); + +untie %hash2; +unlink $inifile; -- cgit v1.2.1 From aa6893958c2bfb6fa4ab923c8466c188c65748fd Mon Sep 17 00:00:00 2001 From: Perl 5 Porters Date: Sat, 22 Feb 1997 04:41:00 +1200 Subject: [inseparable changes from patch from perl5.003_27 to perl5.003_28] CORE LANGUAGE CHANGES Subject: Don't let C undefine &foo From: Chip Salzenberg Files: op.c Subject: Make code, doc agree on $ENV{PATH} and `cmd` From: Chip Salzenberg Files: pod/perlsec.pod pp_sys.c Subject: Optimize keys() and values() in void context From: Chip Salzenberg Files: doop.c op.c CORE PORTABILITY Subject: VMS patches post _27 Date: Thu, 20 Feb 1997 01:58:46 -0500 (EST) From: Charles Bailey Files: MANIFEST dosish.h hv.c lib/ExtUtils/MM_VMS.pm lib/ExtUtils/xsubpp perl.c perlsdio.h pod/perldelta.pod pod/perlvar.pod t/op/closure.t unixish.h vms/Makefile vms/descrip.mms vms/ext/filespec.t vms/genconfig.pl vms/vms.c vms/vmsish.h private-msgid: <01IFMEMPN1IU0057E2@hmivax.humgen.upenn.edu> Subject: Re: OS/2 patch for _27 Date: Thu, 20 Feb 1997 19:24:16 -0500 (EST) From: Ilya Zakharevich Files: INSTALL README.os2 lib/Test/Harness.pm os2/Changes os2/OS2/PrfDB/t/os2_prfdb.t os2/os2.c os2/os2ish.h os2/perl2cmd.pl perl.c pod/perldelta.pod t/TEST t/harness t/op/magic.t Msg-ID: <199702210024.TAA03174@monk.mps.ohio-state.edu> (applied based on p5p patch as commit 833d3f255ed68b969f062cec63d33f853ed9237c) DOCUMENTATION Subject: INSTALL updates since _26 Date: Tue, 18 Feb 1997 16:00:08 -0500 (EST) From: Andy Dougherty Files: INSTALL Msg-ID: Files: pod/perldelta.pod Subject: Don't recommend impossible //o for C<$x =~ $y> From: Chip Salzenberg Files: pod/perlop.pod Subject: Correct doc that claimed that was never false From: Chip Salzenberg Files: pod/perldelta.pod pod/perlop.pod Subject: Document C<$?> vs. $SIG{CHLD} From: Ulrich Pfeifer Files: pod/perlvar.pod Subject: Add pumpkin.pod From: Chip Salzenberg Files: MANIFEST Porting/pumpkin.pod Subject: Don't say "associat*ve arr*y" From: Chip Salzenberg Files: MANIFEST gv.h hv.c lib/Env.pm lib/overload.pm opcode.pl pod/perl.pod pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod pod/perlguts.pod pod/perlmod.pod pod/perltie.pod pod/perltoc.pod pod/perltrap.pod x2p/a2p.pod OTHER CORE CHANGES Subject: Fix a typo From: Chip Salzenberg Files: pp_sys.c Subject: Fix perl_call_sv(..., G_NOARGS) From: Chip Salzenberg Files: perl.c Subject: Fix SIGSEGV when cloning sub with complex expression From: Chip Salzenberg Files: op.c --- os2/OS2/PrfDB/t/os2_prfdb.t | 2 ++ 1 file changed, 2 insertions(+) (limited to 'os2/OS2/PrfDB/t') diff --git a/os2/OS2/PrfDB/t/os2_prfdb.t b/os2/OS2/PrfDB/t/os2_prfdb.t index a8c9752d36..b9f7d90ae2 100644 --- a/os2/OS2/PrfDB/t/os2_prfdb.t +++ b/os2/OS2/PrfDB/t/os2_prfdb.t @@ -88,6 +88,8 @@ print( OS2::Prf::Set($ini,'bbb', 'xxx','abc') ? "ok 18\n" : print( OS2::Prf::Set($ini,'bbb', 'yyy','456') ? "ok 19\n" : "not ok 19\n# err: `$^E'\n"); +OS2::Prf::Close($ini); + my %hash1; tie %hash1, 'OS2::PrfDB::Sub', $inifile, 'aaa'; -- cgit v1.2.1