summaryrefslogtreecommitdiff
path: root/t/op.each
diff options
context:
space:
mode:
Diffstat (limited to 't/op.each')
-rw-r--r--t/op.each50
1 files changed, 50 insertions, 0 deletions
diff --git a/t/op.each b/t/op.each
new file mode 100644
index 0000000000..8e91950e4b
--- /dev/null
+++ b/t/op.each
@@ -0,0 +1,50 @@
+#!./perl
+
+# $Header: op.each,v 1.0 87/12/18 13:13:23 root Exp $
+
+print "1..2\n";
+
+$h{'abc'} = 'ABC';
+$h{'def'} = 'DEF';
+$h{'jkl'} = 'JKL';
+$h{'xyz'} = 'XYZ';
+$h{'a'} = 'A';
+$h{'b'} = 'B';
+$h{'c'} = 'C';
+$h{'d'} = 'D';
+$h{'e'} = 'E';
+$h{'f'} = 'F';
+$h{'g'} = 'G';
+$h{'h'} = 'H';
+$h{'i'} = 'I';
+$h{'j'} = 'J';
+$h{'k'} = 'K';
+$h{'l'} = 'L';
+$h{'m'} = 'M';
+$h{'n'} = 'N';
+$h{'o'} = 'O';
+$h{'p'} = 'P';
+$h{'q'} = 'Q';
+$h{'r'} = 'R';
+$h{'s'} = 'S';
+$h{'t'} = 'T';
+$h{'u'} = 'U';
+$h{'v'} = 'V';
+$h{'w'} = 'W';
+$h{'x'} = 'X';
+$h{'y'} = 'Y';
+$h{'z'} = 'Z';
+
+@keys = keys(h);
+@values = values(h);
+
+if ($#keys == 29 && $#values == 29) {print "ok 1\n";} else {print "not ok 1\n";}
+
+while (($key,$value) = each(h)) {
+ if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) {
+ $key =~ y/a-z/A-Z/;
+ $i++ if $key eq $value;
+ }
+}
+
+if ($i == 30) {print "ok 2\n";} else {print "not ok 2\n";}