Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / 5.8.0 / Locale / Maketext / test.pl
CommitLineData
86530b38
AT
1# Before `make install' is performed this script should be runnable with
2# `make test'. After `make install' it should work as `perl test.pl'
3# Time-stamp: "2001-06-20 02:12:53 MDT"
4######################### We start with some black magic to print on failure.
5
6# (It may become useful if the test is moved to ./t subdirectory.)
7
8BEGIN { $| = 1; print "1..5\n"; }
9END {print "fail 1\n" unless $loaded;}
10use Locale::Maketext 1.01;
11print "# Perl v$], Locale::Maketext v$Locale::Maketext::VERSION\n";
12$loaded = 1;
13print "ok 1\n";
14{
15 package Woozle;
16 @ISA = ('Locale::Maketext');
17 sub dubbil { return $_[1] * 2 }
18 sub numerate { return $_[2] . 'en' }
19}
20{
21 package Woozle::elx;
22 @ISA = ('Woozle');
23 %Lexicon = (
24 'd2' => 'hum [dubbil,_1]',
25 'd3' => 'hoo [quant,_1,zaz]',
26 'd4' => 'hoo [*,_1,zaz]',
27 );
28}
29
30$lh = Woozle->get_handle('elx');
31if($lh) {
32 print "ok 2\n";
33
34 my $x;
35
36 $x = $lh->maketext('d2', 7);
37 if($x eq "hum 14") {
38 print "ok 3\n";
39 } else {
40 print "fail 3 # (got \"$x\")\n";
41 }
42
43 $x = $lh->maketext('d3', 7);
44 if($x eq "hoo 7 zazen") {
45 print "ok 4\n";
46 } else {
47 print "fail 4 # (got \"$x\")\n";
48 }
49
50 $x = $lh->maketext('d4', 7);
51 if($x eq "hoo 7 zazen") {
52 print "ok 5\n";
53 } else {
54 print "fail 5 # (got \"$x\")\n";
55 }
56
57
58} else {
59 print "fail 2\n";
60}
61#Shazam!