Branch Coverage

src/xs/date.cc
Criterion Covered Total %
branch 66 102 64.7


line true false branch
11 2 510 if (!arg) return Date(0, zone);
12 0 510 if (!arg.defined()) return Date("!"); // date with parsing error
0 0 if (!arg.defined()) return Date("!"); // date with parsing error
14 43 467 if (SvROK(arg)) {
16 40 3 if (SvOBJECT(v)) {
17 40 0 Object o = v;
18 40 0 if (o.stash().name() == "Date") return *xs::in(arg);
40 0 if (o.stash().name() == "Date") return *xs::in(arg);
39 1 if (o.stash().name() == "Date") return *xs::in(arg);
39 0 if (o.stash().name() == "Date") return *xs::in(arg);
39 0 if (o.stash().name() == "Date") return *xs::in(arg);
19 1 0 return Date(xs::in(arg), zone, fmt);
1 0 return Date(xs::in(arg), zone, fmt);
24 1 466 SvGETMAGIC(arg);
0 1 SvGETMAGIC(arg);
26 411 56 if (SvNIOK(arg) || arg.is_like_number()) {
0 411 if (SvNIOK(arg) || arg.is_like_number()) {
56 411 if (SvNIOK(arg) || arg.is_like_number()) {
27 2 54 if (SvNOK(arg)) return Date((double)SvNV(arg), zone);
2 0 if (SvNOK(arg)) return Date((double)SvNV(arg), zone);
36 49 460 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
49 0 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
10 39 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
509 0 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
10 499 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
10 0 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
0 0 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
41 6 559 if (!arg.defined()) return DateRel();
6 0 if (!arg.defined()) return DateRel();
43 44 515 if (arg.is_ref()) return *xs::in(arg);
34 10 if (arg.is_ref()) return *xs::in(arg);
34 0 if (arg.is_ref()) return *xs::in(arg);
45 0 515 SvGETMAGIC(arg);
0 0 SvGETMAGIC(arg);
0 0 SvGETMAGIC(arg);
47 503 12 if (SvNIOK(arg) || arg.is_like_number()) return DateRel(0, 0, 0, 0, 0, xs::in(arg));
503 0 if (SvNIOK(arg) || arg.is_like_number()) return DateRel(0, 0, 0, 0, 0, xs::in(arg));
2 501 if (SvNIOK(arg) || arg.is_like_number()) return DateRel(0, 0, 0, 0, 0, xs::in(arg));
14 501 if (SvNIOK(arg) || arg.is_like_number()) return DateRel(0, 0, 0, 0, 0, xs::in(arg));
14 0 if (SvNIOK(arg) || arg.is_like_number()) return DateRel(0, 0, 0, 0, 0, xs::in(arg));
14 0 if (SvNIOK(arg) || arg.is_like_number()) return DateRel(0, 0, 0, 0, 0, xs::in(arg));
49 501 0 auto ret = DateRel(xs::in(arg));
501 0 auto ret = DateRel(xs::in(arg));
50 11 490 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
11 0 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
5 6 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
501 0 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
5 496 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
5 0 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
0 0 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
51 496 0 return ret;