Gecoder C0 Coverage Information - RCov

lib/gecoder/interface/constraints/int_enum/equality.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/gecoder/interface/constraints/int_enum/equality.rb 37 25
100.00%
100.00%

Key

Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.

Coverage Details

1 module Gecode::IntEnum
2   class IntEnumConstraintReceiver
3     # Constrains all operands in the enumeration to be equal. 
4     # Neither negation nor reification is supported.
5     # 
6     # ==== Examples 
7     # 
8     #   # Constrains all operands in +int_enum+ to be equal.
9     #   int_enum.must_be.equal
10     def equal(options = {})
11       if @params[:negate]
12         # The best we could implement it as from here would be a bunch of 
13         # reified pairwise inequality constraints.
14         raise Gecode::MissingConstraintError, 'A negated equality is not ' + 
15           'implemented.'
16       end
17       unless options[:reify].nil?
18         raise ArgumentError, 'Reification is not supported by the equality ' + 
19           'constraint.'
20       end
21     
22       @model.add_constraint Equality::EqualityConstraint.new(@model, 
23         @params.update(Gecode::Util.decode_options(options)))
24     end
25   end
26   
27   # A module that gathers the classes and modules used in equality constraints.
28   module Equality #:nodoc:
29     class EqualityConstraint < Gecode::Constraint #:nodoc:
30       def post
31         Gecode::Raw::rel(@model.active_space,
32           @params[:lhs].to_int_enum.bind_array, 
33           Gecode::Raw::IRT_EQ, *propagation_options)
34       end
35     end
36   end
37 end

Generated on Thu Jan 08 13:27:03 +0100 2015 with rcov 1.0.0