Sha256: 40017caa7ddff7a65337c2100fda7e959703797f6713876d82218441d0733961
Contents?: true
Size: 1.16 KB
Versions: 36
Compression:
Stored size: 1.16 KB
Contents
require "#{File.dirname(__FILE__)}/spec_helper" describe 'Unifying a bound value' do [nil, true, false, :sym, "str", /regex/, 3, 2.0, Object.new, Class.new.new, [], {}].each do |type| describe "for #{type.class} instances" do it 'passes unification for an object of equal value' do local do |var, var2| unify var, type var.should == type type.should == var lambda {unify var, type}.should_not raise_error unify var2, type var.should == var2 var2.should == var lambda {unify var, var2}.should_not raise_error end end it 'fails unification for an object of inequal value' do different = Object.new local do |var, var2| unify var, type var.should_not == different different.should_not == var lambda {unify var, different}.should raise_error(Dataflow::UnificationError) unify var2, different var.should_not == var2 var2.should_not == var lambda {unify var, different}.should raise_error(Dataflow::UnificationError) end end end end end
Version data entries
36 entries across 36 versions & 3 rubygems