Sha256: a8c4afee68ccaefc337a90ad92085cb27ea8a1233a8049fcccdb11c0227a3adc

Contents?: true

Size: 637 Bytes

Versions: 19

Compression:

Stored size: 637 Bytes

Contents

require 'spec_helper'
module Finitio
  describe AnyType, "equality" do

    let(:anyType) { AnyType.new }
    let(:anyType2){ AnyType.new("foo") }
    let(:fltType) { BuiltinType.new(Float)   }

    it 'should apply structural equality' do
      expect(anyType == anyType2).to eq(true)
    end

    it 'should apply distinguish different types' do
      expect(anyType == fltType).to eq(false)
    end

    it 'should be a total function, with nil for non types' do
      expect(anyType == 12).to eq(false)
    end

    it 'should implement hash accordingly' do
      expect(anyType.hash == anyType2.hash).to eq(true)
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
finitio-0.12.0 spec/type/any_type/test_equality.rb
finitio-0.11.4 spec/type/any_type/test_equality.rb
finitio-0.11.3 spec/type/any_type/test_equality.rb
finitio-0.11.2 spec/type/any_type/test_equality.rb
finitio-0.11.1 spec/type/any_type/test_equality.rb
finitio-0.10.0 spec/type/any_type/test_equality.rb
finitio-0.9.1 spec/type/any_type/test_equality.rb
finitio-0.9.0 spec/type/any_type/test_equality.rb
finitio-0.8.0 spec/type/any_type/test_equality.rb
finitio-0.7.0 spec/type/any_type/test_equality.rb
finitio-0.7.0.pre.rc4 spec/type/any_type/test_equality.rb
finitio-0.7.0.pre.rc3 spec/type/any_type/test_equality.rb
finitio-0.7.0.pre.rc2 spec/type/any_type/test_equality.rb
finitio-0.7.0.pre.rc1 spec/type/any_type/test_equality.rb
finitio-0.6.1 spec/type/any_type/test_equality.rb
finitio-0.6.0 spec/type/any_type/test_equality.rb
finitio-0.5.2 spec/type/any_type/test_equality.rb
finitio-0.5.1 spec/type/any_type/test_equality.rb
finitio-0.5.0 spec/type/any_type/test_equality.rb