Sha256: afd8762d5ccc692ed595fa042997445ca7bae7c12dbc09074d29524b59c89f60

Contents?: true

Size: 812 Bytes

Versions: 19

Compression:

Stored size: 812 Bytes

Contents

require 'spec_helper'

describe "The alias keyword" do
  describe "with fitem" do
    it "should return an s(:alias) with s(:lit)" do
      opal_parse("alias a b").should == [:alias, [:lit, :a], [:lit, :b]]
      opal_parse("alias == equals").should == [:alias, [:lit, :==], [:lit, :equals]]
    end

    it "should accept symbols as names" do
      opal_parse("alias :foo :bar").should == [:alias, [:lit, :foo], [:lit, :bar]]
    end
  end

  describe "with gvar" do
    it "should return a s(:valias) with two gvars as arguments" do
      opal_parse("alias $foo $bar").should == [:valias, :$foo, :$bar]
    end
  end

  describe "with gvar and nth ref" do
    it "should return a s(:valias) with two values as arguments" do
      opal_parse("alias $foo $1").should == [:valias, :$foo, :"$1"]
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
opal-0.3.41 spec/grammar/alias_spec.rb
opal-0.3.40 spec/grammar/alias_spec.rb
opal-0.3.39 spec/grammar/alias_spec.rb
opal-0.3.38 spec/grammar/alias_spec.rb
opal-0.3.37 spec/grammar/alias_spec.rb
opal-0.3.36 spec/grammar/alias_spec.rb
opal-0.3.35 spec/grammar/alias_spec.rb
opal-0.3.34 spec/grammar/alias_spec.rb
opal-0.3.33 spec/grammar/alias_spec.rb
opal-0.3.32 spec/grammar/alias_spec.rb
opal-0.3.31 spec/grammar/alias_spec.rb
opal-0.3.30 spec/grammar/alias_spec.rb
opal-0.3.29 spec/grammar/alias_spec.rb
opal-0.3.28 spec/grammar/alias_spec.rb
opal-0.3.27 spec/lib/grammar/alias_spec.rb
opal-0.3.26 spec/lib/grammar/alias_spec.rb
opal-0.3.25 spec/lib/grammar/alias_spec.rb
opal-0.3.22 spec/grammar/alias_spec.rb
opal-0.3.21 spec/grammar/alias_spec.rb