Server/Command/Expunge.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 28.7
CC
5
Cov
0%
validate
30.0
run
2.0
BEGIN
2.0
CRAP 17.6
1 package Net::IMAP::Server::Command::Expunge;
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 return $self->bad_command("Mailbox is read-only") if $self->connection->selected->read_only;
16  
17 my @options = $self->parsed_options;
18 return $self->bad_command("Too many options") if @options;
19  
20 return 1;
21 }
22  
23 sub run {
24 my $self = shift;
25  
26 $self->connection->selected->expunge;
27  
28 $self->ok_completed();
29 }
30  
31 1;