home *** CD-ROM | disk | FTP | other *** search
- require 'abbrev.pl';
-
- print "1..2\n";
-
- %abdul = ();
-
- &abbrev (*abdul, 'he', 'help', 'hi', 'bye', 'wally', 'world');
-
- @good = ('b', 'by', 'bye', 'he', 'hel', 'help', 'hi', 'wa',
- 'wa', 'wal', 'wall', 'wally', 'wo', 'wor', 'worl',
- 'world');
-
- @bad = ('barf', 'bad', 'byef', 'hell', 'wallo', 'waldo', 'will');
-
- $ok = 1;
- foreach (@good) {
- $ok = 0 if !defined($abdul{$_});
- }
- if ($ok) {print "ok 1\n";} else {print "not ok 1\n";}
-
- $ok = 1;
- foreach (@bad) {
- $ok = 0 if defined($abdul{$_});
- }
- if ($ok) {print "ok 2\n";} else {print "not ok 2\n";}
-