Sha256: e5c82de37c4e09eea87f12b66beb58a0a60021b84dac7dfaffd1d1a8a873e56e
Contents?: true
Size: 1.25 KB
Versions: 19
Compression:
Stored size: 1.25 KB
Contents
require 'support/parser_helpers' describe Opal::Parser do describe '-@' do context 'with an integer' do it "parses unary op. with the right precedence" do parsed("-1.hello").should == [:call, [:int, -1], :hello, [:arglist]] end it "parses unary op. as a method call" do parsed("-1").should == [:int, -1] end end context 'with a float' do it "parses unary op. with the right precedence" do parsed("-1.23.hello").should == [:call, [:float, -1.23], :hello, [:arglist]] end it "parses unary op. as a method call" do parsed("-1.23").should == [:float, -1.23] end end end describe '+@' do context 'with an integer' do it "parses unary op. with the right precedence" do parsed("+1.hello").should == [:call, [:int, 1], :hello, [:arglist]] end it "parses unary op. as a method call" do parsed("-1").should == [:int, -1] end end context 'with a float' do it "parses unary op. with the right precedence" do parsed("+1.23.hello").should == [:call, [:float, 1.23], :hello, [:arglist]] end it "parses unary op. as a method call" do parsed("-1.23").should == [:float, -1.23] end end end end
Version data entries
19 entries across 19 versions & 3 rubygems