Sha256: 189b833500dcb1366cf5c9e5dd8403d9974283bbd9fd5a40737c20a6a70d3e64

Contents?: true

Size: 540 Bytes

Versions: 39

Compression:

Stored size: 540 Bytes

Contents

require 'support/parser_helpers'

describe "The while keyword" do
  it "returns an s(:while) with the given expr, body and true for head" do
    parsed("while 1; 2; end").should == [:while, [:int, 1], [:int, 2]]
  end

  it "uses an s(:block) if body has more than one statement" do
    parsed("while 1; 2; 3; end").should == [:while, [:int, 1], [:block, [:int, 2], [:int, 3]]]
  end

  it "treats the prefix while statement just like a regular while statement" do
    parsed("1 while 2").should == [:while, [:int, 2], [:int, 1]]
  end
end

Version data entries

39 entries across 39 versions & 3 rubygems

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