Sha256: 9a220ff11e5de7bc5c22508836e480e882502a016c1d28c58a42b9a710be4b47
Contents?: true
Size: 829 Bytes
Versions: 16
Compression:
Stored size: 829 Bytes
Contents
require 'support/parser_helpers' 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
16 entries across 16 versions & 2 rubygems