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

Version Path
wlang-3.0.1 spec/unit/compiler/test_static_merger.rb
wlang-3.0.0 spec/unit/compiler/test_static_merger.rb
wlang-2.3.1 spec/unit/compiler/test_static_merger.rb
wlang-2.3.0 spec/unit/compiler/test_static_merger.rb
wlang-2.2.4 spec/unit/compiler/test_static_merger.rb
wlang-2.2.3 spec/unit/compiler/test_static_merger.rb
wlang-2.2.2 spec/unit/compiler/test_static_merger.rb
wlang-2.2.1 spec/unit/compiler/test_static_merger.rb
wlang-2.2.0 spec/unit/compiler/test_static_merger.rb
wlang-2.1.2 spec/unit/compiler/test_static_merger.rb
wlang-2.1.1 spec/unit/compiler/test_static_merger.rb
wlang-2.1.0 spec/unit/compiler/test_static_merger.rb
wlang-2.0.1 spec/unit/compiler/test_static_merger.rb
wlang-2.0.0 spec/unit/compiler/test_static_merger.rb
wlang-2.0.0.beta spec/unit/compiler/test_static_merger.rb