mirror of
https://github.com/audacity/linuxdeploy.git
synced 2026-04-12 21:25:04 -05:00
Test localized keys support
This is the unit test that was missing to cover the use case described in #69.
This commit is contained in:
@@ -359,3 +359,28 @@ TEST_F(DesktopFileReaderTest, testReadBrokenSectionMissingOpeningBracket) {
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: introduce proper localization support
|
||||
TEST_F(DesktopFileReaderTest, testReadLocalizedEntriesWithoutProperLocalizationSupport) {
|
||||
std::stringstream ss;
|
||||
ss << "[Desktop File]" << std::endl
|
||||
<< "Name=name" << std::endl
|
||||
<< "Name[de]=name" << std::endl
|
||||
<< "Exec=exec" << std::endl;
|
||||
|
||||
DesktopFileReader reader(ss);
|
||||
|
||||
auto section = reader["Desktop File"];
|
||||
EXPECT_FALSE(section.empty());
|
||||
|
||||
auto data = reader.data();
|
||||
|
||||
auto expected = DesktopFile::section_t({
|
||||
{"Name", DesktopFileEntry("Name", "name")},
|
||||
// FIXME: revise after introduction of localization support
|
||||
{"Name[de]", DesktopFileEntry("Name[de]", "name")},
|
||||
{"Exec", DesktopFileEntry("Exec", "exec")},
|
||||
});
|
||||
|
||||
EXPECT_EQ(data["Desktop File"], expected);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user