Branch Coverage

lib/String/Mask/XS.xs
Criterion Covered Total %
branch 35 42 83.3


line true false branch
9 0 18 if (length == 0) return str;
11 160 18 while(i < length) {
13 152 8 if (str[pos] != '.' && str[pos] != '@') {
146 6 if (str[pos] != '.' && str[pos] != '@') {
22 0 18 if (length == 0) return str;
24 156 18 while(i < length) {
25 156 0 if (str[i] != '.' && str[i] != '@') {
154 2 if (str[i] != '.' && str[i] != '@') {
34 0 10 if (length == 0) return str;
42 0 4 if (length == 0) return str;
44 36 4 while ( str[pos] != '@' ) {
45 32 4 if (str[pos] != '.') {
51 32 4 while(length > 0) {
52 32 0 if (str[pos] != '.' && str[pos] != '@') {
32 0 if (str[pos] != '.' && str[pos] != '@') {
62 8 22 if (strcmp(pos, "end") == 0) {
64 10 12 } else if (strcmp(pos, "middle") == 0) {
66 4 8 } else if (strcmp(pos, "email") == 0) {
79 26 4 char * pos = items > 1 ? SvPV_nolen(ST(1)) : "start";
80 16 14 double len = items > 2 ? SvIV(ST(2)) : floor(strlen(str) / 2);
81 2 28 char * mask_char = items > 3 ? SvPV_nolen(ST(3)) : "*";