source:
branches/UKMO/dev_r5518_eliminate_stop_on_trend_diag_check/NEMOGCM/EXTERNAL/fcm/t/Fcm/Keyword/Formatter/Entries.t
@
6474
Last change on this file since 6474 was 6474, checked in by drew, 8 years ago | |
---|---|
File size: 701 bytes |
Rev | Line | |
---|---|---|
[1980] | 1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use Fcm::Keyword::Entries; | |
7 | use Test::More qw{no_plan}; | |
8 | ||
9 | main(); | |
10 | ||
11 | sub main { | |
12 | my $class = 'Fcm::Keyword::Formatter::Entries'; | |
13 | use_ok($class); | |
14 | test_normal($class); | |
15 | } | |
16 | ||
17 | ################################################################################ | |
18 | # Tests normal usage | |
19 | sub test_normal { | |
20 | my ($class) = @_; | |
21 | my $prefix = 'normal'; | |
22 | my $formatter = $class->new(); | |
23 | isa_ok($formatter, $class, $prefix); | |
24 | my $entries = Fcm::Keyword::Entries->new(); | |
25 | $entries->add_entry('foo', 'food'); | |
26 | $entries->add_entry('bar', 'barley'); | |
27 | is($formatter->format($entries), "BAR = barley\nFOO = food\n", | |
28 | "$prefix: format"); | |
29 | } | |
30 | ||
31 | __END__ |
Note: See TracBrowser
for help on using the repository browser.