Server/Command/Close.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 34 CC 5 SCAR 23.9
CC
5
Cov
0%
validate
20.0
run
6.0
BEGIN
2.0
CRAP 10.9
1 package Net::IMAP::Server::Command::Close;
2  
3 use warnings;
4 use strict;
5  
6 use base qw/Net::IMAP::Server::Command/;
7  
8 sub validate {
9 my $self = shift;
10  
11 return $self->bad_command("Log in first") if $self->connection->is_unauth;
12 return $self->bad_command("Select a mailbox first")
13 unless $self->connection->is_selected;
14  
15 my @options = $self->parsed_options;
16 return $self->bad_command("Too many options") if @options;
17  
18 return 1;
19 }
20  
21 sub run {
22 my $self = shift;
23  
24 $self->connection->selected->expunge unless $self->connection->selected->read_only;
25 $self->connection->selected(undef);
26  
27 $self->ok_completed();
28 }
29  
30 1;