New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Exception.t in branches/2014/dev_r4650_UKMO14.5_SST_BIAS_CORRECTION/NEMOGCM/EXTERNAL/fcm/t/Fcm – NEMO

source: branches/2014/dev_r4650_UKMO14.5_SST_BIAS_CORRECTION/NEMOGCM/EXTERNAL/fcm/t/Fcm/Exception.t @ 5967

Last change on this file since 5967 was 5967, checked in by timgraham, 8 years ago

Reset keywords before merging with head of trunk

  • Property svn:keywords set to Id
File size: 912 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More qw{no_plan};
7
8main();
9
10sub main {
11    my $class = 'Fcm::Exception';
12    use_ok($class);
13    test_constructor_empty($class);
14    test_normal($class);
15}
16
17################################################################################
18# Tests empty constructor
19sub test_constructor_empty {
20    my ($class) = @_;
21    my $prefix = 'empty constructor';
22    my $e = $class->new();
23    isa_ok($e, $class, $prefix);
24    isnt("$e", undef, "$prefix: as_string() not undef");
25}
26
27################################################################################
28# Tests normal usage
29sub test_normal {
30    my ($class) = @_;
31    my $prefix = 'normal';
32    my $e = $class->new({message => 'message'});
33    isa_ok($e, $class, $prefix);
34    is("$e", "$class: message\n", "$prefix: as_string()");
35    is($e->get_message(), 'message', "$prefix: get_message()");
36}
37
38__END__
Note: See TracBrowser for help on using the repository browser.