diff options
author | Gwyneth Morgan <gwymor@tilde.club> | 2023-09-12 19:50:24 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2023-10-12 13:55:48 -0700 |
commit | f480f37a847100d351a970a1b83a86d9eeccbcc7 (patch) | |
tree | 1d47f591c525e948496a38195e22d5b11b80b484 /test/unit/t_expr.cc | |
parent | 4355c4faf157d5ef47b126286aa501742732708d (diff) | |
download | fork-ledger-f480f37a847100d351a970a1b83a86d9eeccbcc7.tar.gz fork-ledger-f480f37a847100d351a970a1b83a86d9eeccbcc7.tar.bz2 fork-ledger-f480f37a847100d351a970a1b83a86d9eeccbcc7.zip |
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
Diffstat (limited to 'test/unit/t_expr.cc')
-rw-r--r-- | test/unit/t_expr.cc | 4 |
1 files changed, 2 insertions, 2 deletions
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 |