Class: DeepCover::Analyser::Branch
Constant Summary
collapse
- SUBSET_CLASSES =
[Node::Branch].freeze
Instance Attribute Summary
Attributes included from Base
#options, #source
Instance Method Summary
collapse
Methods included from Subset
#node_children
#optionally_covered
#initialize, #node_runs
Methods included from Base
#covered_code, #each_node, #initialize, #node_children, #node_runs, #node_runs_map
Instance Method Details
#is_trivial_if?(node) ⇒ Boolean
17
18
19
20
|
# File 'lib/deep_cover/analyser/branch.rb', line 17
def is_trivial_if?(node)
parent = node.parent
parent.is_a?(Node::If) && parent.condition.is_a?(Node::SingletonLiteral)
end
|
#results ⇒ Object
10
11
12
13
14
15
|
# File 'lib/deep_cover/analyser/branch.rb', line 10
def results
each_node.map do |node|
branches_runs = node.branches.map { |b| [b, node_runs(b)] }.to_h
[node, branches_runs]
end.to_h
end
|