| blib/lib/Rope/Handles/Bool.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 17 | 18 | 94.4 |
| branch | 1 | 2 | 50.0 |
| condition | n/a | ||
| subroutine | 7 | 8 | 87.5 |
| pod | 5 | 6 | 83.3 |
| total | 30 | 34 | 88.2 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Rope::Handles::Bool; | ||||||
| 2 | |||||||
| 3 | 1 | 1 | 133411 | use strict; | |||
| 1 | 2 | ||||||
| 1 | 44 | ||||||
| 4 | 1 | 1 | 11 | use warnings; | |||
| 1 | 3 | ||||||
| 1 | 267 | ||||||
| 5 | |||||||
| 6 | sub new { | ||||||
| 7 | 1 | 1 | 0 | 236926 | my ($class, $str) = @_; | ||
| 8 | 1 | 5 | bless \$str, __PACKAGE__; | ||||
| 9 | } | ||||||
| 10 | |||||||
| 11 | 1 | 1 | 1 | 6 | sub set { ${$_[0]} = 1 } | ||
| 1 | 12 | ||||||
| 12 | |||||||
| 13 | 2 | 2 | 1 | 6 | sub unset { ${$_[0]} = 0 } | ||
| 2 | 8 | ||||||
| 14 | |||||||
| 15 | 1 | 50 | 1 | 1 | 3 | sub toggle { ${$_[0]} = ${$_[0]} ? 0 : 1; } | |
| 1 | 8 | ||||||
| 1 | 5 | ||||||
| 16 | |||||||
| 17 | 2 | 2 | 1 | 4 | sub not { !${$_[0]} } | ||
| 2 | 11 | ||||||
| 18 | |||||||
| 19 | 0 | 0 | 1 | sub clear { $_[0]->unset } | |||
| 20 | |||||||
| 21 | 1; | ||||||
| 22 | |||||||
| 23 | __END__ |