File Coverage

src/xs/KeyProxy.cc
Criterion Covered Total %
statement 10 10 100.0
branch 14 24 58.3
condition n/a
subroutine n/a
pod n/a
total 24 34 70.5


line stmt bran cond sub pod time code
1             #include
2             #include
3             #include
4              
5             namespace xs {
6              
7 10           KeyProxy KeyProxy::_geti (size_t key) {
8 10 100         if (SvROK(sv)) {
9 16 50         Array a(SvRV(sv));
10 16 50         if (a) return a[key];
    50          
    50          
11             }
12 2 50         throw std::invalid_argument("element is not an array reference");
13             }
14              
15 10           KeyProxy KeyProxy::operator[] (const panda::string_view& key) {
16 10 100         if (SvROK(sv)) {
17 16 50         Hash h(SvRV(sv));
18 16 50         if (h) return h[key];
    50          
    50          
19             }
20 2 50         throw std::invalid_argument("element is not a hash reference");
21             }
22              
23             }