Sha256: 725d2f8229b599e94dd00644c581120c7400c10d446227e67f27174fc90ff953

Contents?: true

Size: 1.12 KB

Versions: 10

Compression:

Stored size: 1.12 KB

Contents

describe "NestingParser" do
  describe "Consuming" do
    before do
      @parser = ParsingNesting::Grammar.new
    end
    # Whole bunch of things we just want to make sure they are consumed
    # without error, not checking the generated tree yet.
    ["foo",
     "foo bar",
     " foo bar ",
     " foo bar   baz    ",
     "+foo",
     "-foo",
     "+foo -bar",
     "one +two three -four five",
     "foo AND bar",
     "one AND two AND three AND four",
     "one OR two OR three OR four",
     "white OR blue AND big OR small",
     "+yes AND book OR -online",
     "(one AND two)",
     "  (  one   AND     two     )  ",
     "(one OR two) three +four",
     "(one AND two) OR three",
     "(one AND -two) AND (+three OR (-four AND five))",
     "one two three NOT four",
     "one two three NOT (four OR five)",
     "NOT four",
     "NOT (four five)",
     "(one two three) OR (four five) AND six",
     '"foo+bar (baz"',
     "(foo bar one AND two) AND (three four ten OR twelve)"
    ].each do |query|
      it "should consume<<#{query}>>" do
        expect { @parser.parse(query) }.not_to raise_error
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
blacklight_advanced_search-8.0.0.alpha2 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-8.0.0.alpha1 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-7.0.0 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-6.4.1 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-6.4.0 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-6.3.1 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-6.3.0 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-6.2.1 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-6.2.0 spec/parsing_nesting/consuming_spec.rb
blacklight_advanced_search-6.1.0 spec/parsing_nesting/consuming_spec.rb