Skip to content

Commit

Permalink
Add test cases to check for exact token matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Gruber committed Feb 2, 2020
1 parent 073e478 commit 9b3085a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libgnucash/engine/test/gtest-import-map.cpp
Expand Up @@ -271,6 +271,14 @@ TEST_F(ImapBayesTest, FindAccountBayes)
EXPECT_EQ(t_expense_account2, account);
account = gnc_account_imap_find_account_bayes(t_imap, t_list5);
EXPECT_EQ(nullptr, account);

// only imap entries with exact token matching should be considered
root->set_path({std::string{IMAP_FRAME_BAYES} + "/" + pepper + waldo + "/" + acct2_guid}, new KvpValue{*value});
account = gnc_account_imap_find_account_bayes(t_imap, t_list3);
EXPECT_EQ(t_expense_account1, account);
root->set_path({std::string{IMAP_FRAME_BAYES} + "/" + pepper + "/" + waldo + "/" + acct2_guid}, new KvpValue{*value});
account = gnc_account_imap_find_account_bayes(t_imap, t_list3);
EXPECT_EQ(t_expense_account1, account);
}

TEST_F(ImapBayesTest, AddAccountBayes)
Expand Down

0 comments on commit 9b3085a

Please sign in to comment.