Sha256: 586e3486c440b5e444c0f0930239a28e1257e1a675c08b368bd7ee6fadfad169
Contents?: true
Size: 758 Bytes
Versions: 2
Compression:
Stored size: 758 Bytes
Contents
require 'spec_helper' module Finitio describe Syntax, "union_type" do subject{ Syntax.parse(input, root: "union_type") } describe "compilation result" do let(:compiled){ subject.compile(type_factory) } context '.Integer|.Float' do let(:input){ '.Integer|.Float' } it 'compiles to a UnionType' do compiled.should be_a(UnionType) compiled.should eq(UnionType.new([intType, floatType])) end end end describe "AST" do let(:input){ '.Integer|.Float' } let(:ast){ subject.to_ast } it{ ast.should eq([ :union_type, [:builtin_type, "Integer"], [:builtin_type, "Float"] ]) } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
finitio-0.4.1 | spec/unit/syntax/nodes/test_union_type.rb |
finitio-0.4.0 | spec/unit/syntax/nodes/test_union_type.rb |