Sha256: 2ee5d7af1e1dc1961b7056abc811c7d551c467e50a04e52f326fbffa83ce5bee
Contents?: true
Size: 852 Bytes
Versions: 4
Compression:
Stored size: 852 Bytes
Contents
require File.expand_path('../../spec_helper', __FILE__) describe "The not keyword" do it "returns a call sexp" do parsed("not self").should == [:call, [:self], '!'.to_sym, [:arglist]] parsed("not 42").should == [:call, [:int, 42], '!'.to_sym, [:arglist]] end end describe "The '!' expression" do it "returns a call sexp" do parsed("!self").should == [:call, [:self], '!'.to_sym, [:arglist]] parsed("!42").should == [:call, [:int, 42], '!'.to_sym, [:arglist]] end end describe "The '!=' expression" do it "rewrites as !(lhs == rhs)" do parsed("1 != 2").should == [:call, [:call, [:int, 1], :==, [:arglist, [:int, 2]]], '!'.to_sym, [:arglist]] end end describe "The '!~' expression" do it "rewrites as !(lhs =~ rhs)" do parsed("1 !~ 2").should == [:not, [:call, [:int, 1], :=~, [:arglist, [:int, 2]]]] end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
opal-0.6.3 | spec/cli/parser/not_spec.rb |
opal-0.6.2 | spec/cli/parser/not_spec.rb |
opal-0.6.1 | spec/cli/parser/not_spec.rb |
opal-0.6.0 | spec/cli/parser/not_spec.rb |