Sha256: e9ca07b8868a050b9a1869357f77bfca4e4cd470e02eafb260616df09a5616bd

Contents?: true

Size: 687 Bytes

Versions: 13

Compression:

Stored size: 687 Bytes

Contents

require 'spec_helper'
module WLang
  class Compiler
    describe ToRubyCode do

      def generate(source)
        ToRubyCode.new.call(source)
      end

      it 'compiles [:proc, ...]' do
        source   = [:proc, [:static, "Hello world"]]
        expected = %q{Proc.new{|d1,b1| b1 << ("Hello world") }}
        generate(source).should eq(expected)
      end

      it 'compiles [:dispatch, ...]' do
        source   = [:dispatch, :_tag_36, [:proc, [:static, "Hello world"]]]
        expected = %q{d0._tag_36(b0, Proc.new{|d1,b1| b1 << ("Hello world") })}
        generate(source).should eq(expected)
      end

    end # describe ToRubyCode
  end # class Compiler
end # module WLang

Version data entries

13 entries across 13 versions & 1 rubygems

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