Sha256: 0d092372f3d9ac31952084dcb4be1b36fb9fec5638ee6e34b7b862a15b4b3e2b

Contents?: true

Size: 623 Bytes

Versions: 19

Compression:

Stored size: 623 Bytes

Contents

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

    let(:type) { SeqType.new(intType)   }
    let(:type2){ SeqType.new(intType)   }
    let(:type3){ SeqType.new(floatType) }

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

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

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

    it 'should implement hash accordingly' do
      expect(type.hash == type2.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/seq_type/test_equality.rb
finitio-0.11.4 spec/type/seq_type/test_equality.rb
finitio-0.11.3 spec/type/seq_type/test_equality.rb
finitio-0.11.2 spec/type/seq_type/test_equality.rb
finitio-0.11.1 spec/type/seq_type/test_equality.rb
finitio-0.10.0 spec/type/seq_type/test_equality.rb
finitio-0.9.1 spec/type/seq_type/test_equality.rb
finitio-0.9.0 spec/type/seq_type/test_equality.rb
finitio-0.8.0 spec/type/seq_type/test_equality.rb
finitio-0.7.0 spec/type/seq_type/test_equality.rb
finitio-0.7.0.pre.rc4 spec/type/seq_type/test_equality.rb
finitio-0.7.0.pre.rc3 spec/type/seq_type/test_equality.rb
finitio-0.7.0.pre.rc2 spec/type/seq_type/test_equality.rb
finitio-0.7.0.pre.rc1 spec/type/seq_type/test_equality.rb
finitio-0.6.1 spec/type/seq_type/test_equality.rb
finitio-0.6.0 spec/type/seq_type/test_equality.rb
finitio-0.5.2 spec/type/seq_type/test_equality.rb
finitio-0.5.1 spec/type/seq_type/test_equality.rb
finitio-0.5.0 spec/type/seq_type/test_equality.rb