Branch Coverage

blib/lib/Wasm.pm
Criterion Covered Total %
branch 60 80 75.0


line true false branch
45 2 23 unless @_
47 1 22 if (defined $_[0] and $_[0] ne "-api")
63 23 23 if ($key eq '-api') { }
4 19 elsif ($key eq '-wat') { }
6 13 elsif ($key eq '-file') { }
8 5 elsif ($key eq '-self') { }
3 2 elsif ($key eq '-exporter') { }
1 1 elsif ($key eq '-package') { }
1 0 elsif ($key eq '-global') { }
0 0 elsif ($key eq '-imports') { }
65 1 22 if (defined $api)
70 1 21 unless (defined $api and $api == 0)
78 0 4 unless defined $wat
84 0 6 unless (defined $path and -f $path)
86 0 0 unless defined $path
102 0 8 if (@maybe == 0) { }
122 1 0 if (XXX) { }
143 1 19 if (@global)
145 0 1 if @module
161 1 18 unless @module
163 0 19 if $package =~ /^wasi_/
164 0 19 if $inst{$package}
173 2 9 if ($module =~ /^(wasi_unstable|wasi_snapshot_preview1)$/)
175 0 2 if $WASM{$module}
194 4 4 if ($module ne "main" and not $inst{$module} and not $pp{$module})
199 1 3 if (my $error = $@)
207 4 4 if $inst{$module}
215 2 2 if ($kind eq 'functype') { }
2 0 elsif ($kind eq 'globaltype') { }
217 2 0 if (my $f = $module->can("${module}::$name"))
229 2 0 if (my $global = do { no strict 'refs'; tied ${"${module}::$name";} })
235 4 0 if ($extern)
245 1 3 if (my $error = $@)
247 1 0 if ('Wasm::Wasmtime::Error'->can('new')) { }
253 0 1 unless $error =~ /defined twice/
281 27 13 if ($kind eq 'func') { }
2 11 elsif ($kind eq 'global') { }
11 0 elsif ($kind eq 'memory') { }
302 3 15 if ($exporter)
307 1 2 if ($exporter eq 'all') { }