Sha256: c44ff7790d7f2bbd8cab40050da1756e059c0e3cc6736ea1a6e900a124ce216b
Contents?: true
Size: 833 Bytes
Versions: 20
Compression:
Stored size: 833 Bytes
Contents
require 'spec_helper' describe Finitio, "ast" do subject{ Finitio.ast <<-EOF Posint = .Fixnum( i | i>=0 ) Point = { x: Posint, y: Posint } {{ p: Point }} EOF } let(:expected){ [ :system, [ :type_def, "Posint", [ :sub_type, [:builtin_type, "Fixnum"], [ :constraint, "default", [:fn, [:parameters, "i"], [:source, "i>=0"] ] ] ] ], [ :type_def, "Point", [ :tuple_type, [ :heading, [:attribute, "x", [:type_ref, "Posint"]], [:attribute, "y", [:type_ref, "Posint"]] ] ] ], [ :relation_type, [ :heading, [:attribute, "p", [:type_ref, "Point"]] ] ] ] } it{ should eq(expected) } end
Version data entries
20 entries across 20 versions & 1 rubygems