From f480f37a847100d351a970a1b83a86d9eeccbcc7 Mon Sep 17 00:00:00 2001 From: Gwyneth Morgan Date: Tue, 12 Sep 2023 19:50:24 +0000 Subject: Fix =regex note query syntax The manpage documents `=regex` as equivalent to the `note regex` query syntax, but the former does not actually work as the parser only handles an equals sign in the case of `tag type=dining` syntax, and doesn't handle the case where an equals sign starts a note query. Fixing this does break queries like `tag type = dining` with spaces around the equals sign, but that syntax was not intended or documented. Closes: #2275 --- test/unit/t_expr.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/unit/t_expr.cc') diff --git a/test/unit/t_expr.cc b/test/unit/t_expr.cc index c10ee029..ff30b3ed 100644 --- a/test/unit/t_expr.cc +++ b/test/unit/t_expr.cc @@ -142,7 +142,7 @@ BOOST_AUTO_TEST_CASE(testPredicateTokenizer6) #ifndef NOT_FOR_PYTHON query_t::lexer_t tokens(args.begin(), args.end()); - BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::TOK_EQ, tokens.next_token().kind); + BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::TOK_NOTE, tokens.next_token().kind); BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::TERM, tokens.next_token().kind); BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::TOK_AND, tokens.next_token().kind); BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::TERM, tokens.next_token().kind); @@ -158,7 +158,7 @@ BOOST_AUTO_TEST_CASE(testPredicateTokenizer7) #ifndef NOT_FOR_PYTHON query_t::lexer_t tokens(args.begin(), args.end()); - BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::TOK_EQ, tokens.next_token().kind); + BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::TOK_NOTE, tokens.next_token().kind); BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::TERM, tokens.next_token().kind); BOOST_CHECK_EQUAL(query_t::lexer_t::token_t::END_REACHED, tokens.next_token().kind); #endif -- cgit v1.2.3