From: Peter Prymmer Date: Thu, 6 Aug 1998 18:09:39 +0000 (-0700) Subject: adjust searchdict.t for EBCDIC (still needs documenting) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4beedc23b598a493399ba23c8c4bd5448e52283a;p=p5sagit%2Fp5-mst-13.2.git adjust searchdict.t for EBCDIC (still needs documenting) Message-Id: <9808070109.AA06158@forte.com> Subject: [PATCH 5.005_02-TRIAL2] potential modification to t/lib/searchdict.t p4raw-id: //depot/perl@1802 --- diff --git a/README.os390 b/README.os390 index b5ddaff..37f5f0b 100644 --- a/README.os390 +++ b/README.os390 @@ -80,4 +80,3 @@ op/stat...........Out of memory! op/taint..........FAILED at test 73 lib/errno.........FAILED at test 1 lib/posix.........FAILED at test 19 -lib/searchdict....FAILED at test 1 diff --git a/t/lib/searchdict.t b/t/lib/searchdict.t index 447c425..c36fdb8 100755 --- a/t/lib/searchdict.t +++ b/t/lib/searchdict.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..3\n"; +print "1..4\n"; $DICT = <dict-$$") or die "Can't create dict-$$: $!"; binmode DICT; # To make length expected one. print DICT $DICT; -my $pos = look *DICT, "abash"; +my $pos = look *DICT, "Ababa"; chomp($word = ); -print "not " if $pos < 0 || $word ne "abash"; +print "not " if $pos < 0 || $word ne "Ababa"; print "ok 1\n"; -$pos = look *DICT, "foo"; -chomp($word = ); +if (ord('a') > ord('A') ) { # ASCII + + $pos = look *DICT, "foo"; + chomp($word = ); + + print "not " if $pos != length($DICT); # will search to end of file + print "ok 2\n"; -print "not " if $pos != length($DICT); # will search to end of file -print "ok 2\n"; + my $pos = look *DICT, "abash"; + chomp($word = ); + print "not " if $pos < 0 || $word ne "abash"; + print "ok 3\n"; + +} +else { # EBCDIC systems e.g. os390 + + $pos = look *DICT, "FOO"; + chomp($word = ); + + print "not " if $pos != length($DICT); # will search to end of file + print "ok 2\n"; + + my $pos = look *DICT, "Abba"; + chomp($word = ); + print "not " if $pos < 0 || $word ne "Abba"; + print "ok 3\n"; +} $pos = look *DICT, "aarhus", 1, 1; chomp($word = ); print "not " if $pos < 0 || $word ne "Aarhus"; -print "ok 3\n"; +print "ok 4\n"; close DICT or die "cannot close"; unlink "dict-$$";