Sha256: 2299ba8f62ff4e61304aa5ff010710fc0c799c89f0d13a3670777087c17101dd

Contents?: true

Size: 595 Bytes

Versions: 39

Compression:

Stored size: 595 Bytes

Contents

require 'support/parser_helpers'

describe "The break keyword" do
  it "should return s(:break) when given no args" do
    parsed("break").should == [:break]
  end

  it "returns s(:break) with a single arg not wrapped in s(:array)" do
    parsed("break 1").should == [:break, [:int, 1]]
    parsed("break *1").should == [:break, [:splat, [:int, 1]]]
  end

  it "returns s(:break) with an s(:array) for args size > 1" do
    parsed("break 1, 2").should == [:break, [:array, [:int, 1], [:int, 2]]]
    parsed("break 1, *2").should == [:break, [:array, [:int, 1], [:splat, [:int, 2]]]]
  end
end

Version data entries

39 entries across 39 versions & 3 rubygems

Version Path
opal-0.10.6 spec/lib/parser/break_spec.rb
opal-0.10.6.beta spec/lib/parser/break_spec.rb
opal-0.10.5 spec/lib/parser/break_spec.rb
opal-0.10.4 spec/lib/parser/break_spec.rb
opal-0.10.3 spec/lib/parser/break_spec.rb
opal-0.10.2 spec/lib/parser/break_spec.rb
opal-0.10.1 spec/lib/parser/break_spec.rb
opal-0.10.0 spec/lib/parser/break_spec.rb
opal-0.10.0.rc2 spec/lib/parser/break_spec.rb
opal-0.9.4 spec/lib/parser/break_spec.rb
opal-0.9.3 spec/lib/parser/break_spec.rb
opal-0.10.0.rc1 spec/lib/parser/break_spec.rb
opal-0.10.0.beta5 spec/lib/parser/break_spec.rb
opal-0.10.0.beta4 spec/lib/parser/break_spec.rb
opal-0.10.0.beta3 spec/lib/parser/break_spec.rb
opal-0.10.0.beta2 spec/lib/parser/break_spec.rb
opal-0.10.0.beta1 spec/lib/parser/break_spec.rb
opal-0.9.2 spec/lib/parser/break_spec.rb
opal-0.9.0 spec/lib/parser/break_spec.rb
opal-0.9.0.rc1 spec/lib/parser/break_spec.rb