Add test cases to check for exact token matching

This commit is contained in:
Christian Gruber 2020-01-27 22:38:26 +01:00
parent 073e47801d
commit 9b3085a429

View File

@ -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)