Skip to content

class Crystal::ExhaustivenessChecker::BoolTarget
inherits Crystal::ExhaustivenessChecker::Target

A bool target. Subtargets are the false and true literals.

Methods

#add_subtargets(type_groups : Array(Array(Type)), index : Int32) : Nil

Add subtargets for the given type groups, starting at index.

View source

#cover(patterns : Array(Pattern), index : Int32) : Nil

Covers this target and subsequent subtargets with the patterns starting at index.

View source

#cover(pattern : Pattern) : Nil

Tries to cover this target with the given pattern. By default, a TypePattern will cover a target. Other, more specific, patterns will partially cover a target.

View source

#covered? : Bool

Was this target covered?

View source

#found_false=(found_false)

View source

#found_false? : Bool

View source

#found_true=(found_true)

View source

#found_true? : Bool

View source

#missing_cases : Array(String)

What are the cases that we didn't cover?

View source

#reject_covered! : Bool

Removes covered subtargets from this target, and returns whether this target ended up being entirely covered.

View source

#subtargets : Hash(Bool, Array(Target))

#subtargets=(subtargets : Hash(Bool, Array(Target)))

View source

#subtargets? : Hash(Bool, Array(Target))?