Sha256: af50dd7bf4826ffb3866e365973a8369a219cb76d74bfc35825d26bb5bf05eec

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 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 == [:not, [:call, [:int, 1], :=~, [:arglist, [:int, 2]]]]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-wedge-0.9.0.dev spec/lib/parser/not_spec.rb