File: 031-status_ok.t

package info (click to toggle)
libapp-cell-perl 0.231-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 412 kB
  • sloc: perl: 2,303; makefile: 2
file content (35 lines) | stat: -r--r--r-- 1,143 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!perl -T
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log );
#use App::CELL::Test::LogToFile;
use Data::Dumper;
use Test::More;
use Test::Warnings;

my $status;
$log->init( ident => 'CELLtest' );
$log->info("---------------------------------------------------- ");
$log->info("---               031-status_ok.t                ---");
$log->info("---------------------------------------------------- ");

$status = $CELL->status_ok();
#diag( Dumper( $status ) );
ok( $status->ok, "OK status is OK" );
is( $status->{code}, undef, "real code is undef" );
is( $status->code, '<NONE>', "no code" );
is( $status->{text}, undef, "real text is undef" );
is( $status->text, '<NONE>', "no text" );
is( $status->payload, undef, "payload is undefined" );
is_deeply( $status->args, [], "args is empty" );

$status = $CELL->status_ok( "foobar" );
#diag( Dumper( $status ) );
ok( $status->ok, "OK status is OK" );
is( $status->code, "foobar", "code is as expected" );
is( $status->text, "foobar", "text is as expected" );
is( $status->payload, undef, "payload is undefined" );
is_deeply( $status->args, [], "args is empty" );

done_testing;