Sha256: 79bc2acce7c138c68d52ec4fcb72cce749e60eb8012a203729b7203280445fe5

Contents?: true

Size: 464 Bytes

Versions: 6

Compression:

Stored size: 464 Bytes

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe "Block statements" do
  it "should return the direct expression if only one expresssion in block" do
    opal_parse("42").should == [:lit, 42]
  end

  it "should return an s(:block) with all expressions appended for > 1 expression" do
    opal_parse("42; 43").should == [:block, [:lit, 42], [:lit, 43]]
    opal_parse("42; 43\n44").should == [:block, [:lit, 42], [:lit, 43], [:lit, 44]]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-0.3.20 spec/grammar/block_spec.rb
opal-0.3.19 spec/grammar/block_spec.rb
opal-0.3.18 spec/grammar/block_spec.rb
opal-0.3.17 test/grammar/block_spec.rb
opal-0.3.16 spec/grammar/block_spec.rb
opal-0.3.15 spec/grammar/block_spec.rb