Sha256: de3f4e0725a8ac5971e7b21db1f5a4de959106d86a45e2c6813b4562ef3bd039
Contents?: true
Size: 1.03 KB
Versions: 9
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' module Finitio describe SeqType, "suppremum" do subject{ left.suppremum(right) } let(:left) { SeqType.new(intType) } context 'when right is equal' do let(:right) { SeqType.new(intType) } it 'keeps left' do expect(subject).to be(left) end end context 'when right is a set type of same element type' do let(:right) { SetType.new(intType) } it 'keeps left' do expect(subject).to eql(SeqType.new(intType)) end end context 'when right is not a seq type' do let(:right) { stringType } it 'builds a UnionType' do expect(subject).to eql(UnionType.new [left, right]) end end context 'when right is a seq type of a different element type' do let(:right) { SeqType.new(floatType) } it 'builds a SeqType[UnionType]' do expect(subject).to eql(SeqType.new(UnionType.new [intType, floatType])) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems