Sha256: c72bf26e3c37bc6c5bbc772307cb6f2bd89c9072e7992e5dd25bfd4925951a5b
Contents?: true
Size: 705 Bytes
Versions: 15
Compression:
Stored size: 705 Bytes
Contents
require 'spec_helper' module WLang class Compiler describe StaticMerger do def optimize(source) StaticMerger.new.call(source) end let(:trailing){[ [:strconcat, [:static, "{"], [:static, "Hello world"], [:static, "}"]], [:strconcat, [:static, "{Hello world}"]] ]} it 'optimize result of trailing blocks' do optimize(trailing.first).should eq(trailing.last) end [:template, :modulo, :wlang, :fn].each do |kind| it "recurses on :#{kind}" do optimize([kind, trailing.first]).should eq([kind, trailing.last]) end end end # describe StaticMerger end # class Compiler end # module WLang
Version data entries
15 entries across 15 versions & 1 rubygems