Skip to content

Commit

Permalink
Add a test for MRU lists with special characters
Browse files Browse the repository at this point in the history
This fails on Windows since the switch to std::filesystem,
but would have succeeded with boost::filesystem.
  • Loading branch information
arch1t3cht committed Dec 21, 2024
1 parent e21e32e commit 38e66a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/tests/mru.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ TEST(lagi_mru, add_entry) {
EXPECT_STREQ("/path/to/file", mru.Get("Video")->front().string().c_str());
}

TEST(lagi_mru, add_entry_utf8) {
agi::fs::Copy("data/mru_ok.json", "data/mru_tmp");
agi::MRUManager mru("data/mru_tmp", default_mru);
EXPECT_NO_THROW(mru.Add("Video", "/path/with/accents/é/日本語"));
EXPECT_STREQ("/path/with/accents/é/日本語", mru.Get("Video")->front().string().c_str());
EXPECT_STREQ(L"/path/with/accents/é/日本語", mru.Get("Video")->front().wstring().c_str());
}

TEST(lagi_mru, remove_entry) {
agi::fs::Copy("data/mru_ok.json", "data/mru_tmp");
agi::MRUManager mru("data/mru_tmp", default_mru);
Expand Down

0 comments on commit 38e66a8

Please sign in to comment.