Sha256: 089987419f2bc3685d0c216e7801126af61883c2e0f98b043db770fcb43c0d03

Contents?: true

Size: 623 Bytes

Versions: 15

Compression:

Stored size: 623 Bytes

Contents

require 'spec_helper'
module WLang
  class Compiler
    describe ProcCallRemoval do

      def optimize(source)
        ProcCallRemoval.new.call(source)
      end

      it 'optimizes :fn' do
        source   = [:fn, [:static, "Hello world"]]
        expected = [:arg, "Hello world"]
        optimize(source).should eq(expected)
      end

      it 'recurses on :wlang' do
        source   = [:wlang, '$', [:fn, [:static, "Hello world"]]]
        expected = [:wlang, '$', [:arg, "Hello world"]]
        optimize(source).should eq(expected)
      end

    end # describe ToRubyCode
  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_proc_call_removal.rb
wlang-3.0.0 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.3.1 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.3.0 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.2.4 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.2.3 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.2.2 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.2.1 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.2.0 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.1.2 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.1.1 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.1.0 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.0.1 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.0.0 spec/unit/compiler/test_proc_call_removal.rb
wlang-2.0.0.beta spec/unit/compiler/test_proc_call_removal.rb