post queries: track whether metatag values are quoted.

This is necessary for the `commentary:` metatag, which has different
behavior depending on whether the metatag value is quoted. For example,
`commentary:translated` finds translated commentaries, while
`commentary:"translated"` finds commentaries containing the literal word
"translated".
This commit is contained in:
evazion
2022-04-06 17:15:02 -05:00
parent 2adc530ba0
commit a4d43ae72a
3 changed files with 17 additions and 12 deletions

View File

@@ -69,14 +69,14 @@ class PostQueryParserTest < ActiveSupport::TestCase
assert_parse_equals('source:""', 'source:""')
assert_parse_equals('source:"\""', 'source:"\""')
assert_parse_equals(%q{source:"don't say \"lazy\" okay"}, %q{source:"don't say \"lazy\" okay"})
assert_parse_equals(%q{(and source:foo)bar a)}, %q{(a (source:"foo)bar"))})
assert_parse_equals(%q{(and source:"foo)bar" a)}, %q{(a (source:"foo)bar"))})
assert_parse_equals('source:"foo bar"', "source:'foo bar'")
assert_parse_equals("source:foobar'(", "source:foobar'(")
assert_parse_equals('source:""', "source:''")
assert_parse_equals('source:"\'"', "source:'\\''")
assert_parse_equals(%q{source:"don't say \"lazy\" okay"}, %q{source:'don\'t say "lazy" okay'})
assert_parse_equals(%q{(and source:foo)bar a)}, %q{(a (source:'foo)bar'))})
assert_parse_equals(%q{(and source:"foo)bar" a)}, %q{(a (source:'foo)bar'))})
end
should "parse metatag synonyms correctly" do