mirror of
https://github.com/audacity/linuxdeploy.git
synced 2026-04-12 21:25:04 -05:00
Make sure errors are recognized in all sections, not just the first one
This commit is contained in:
@@ -203,25 +203,61 @@ TEST_F(DesktopFileReaderFixture, testParseLinesWithMultipleSpaces) {
|
||||
}
|
||||
|
||||
TEST_F(DesktopFileReaderFixture, testReadBrokenSectionHeaderMissingClosingBracket) {
|
||||
std::stringstream ins;
|
||||
ins << "[Desktop Entry" << std::endl
|
||||
<< "test=test" << std::endl;
|
||||
{
|
||||
std::stringstream ins;
|
||||
ins << "[Desktop Entry" << std::endl
|
||||
<< "test=test" << std::endl;
|
||||
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
}
|
||||
|
||||
// also test for brokenness in a later section, as the first section is normally treated specially
|
||||
{
|
||||
std::stringstream ins;
|
||||
ins << "[Desktop Entry]" << std::endl
|
||||
<< "test=test" << std::endl
|
||||
<< "[Another Section" << std::endl;
|
||||
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DesktopFileReaderFixture, testReadBrokenSectionHeaderTooManyClosingBrackets) {
|
||||
std::stringstream ins;
|
||||
ins << "[Desktop Entry]]" << std::endl
|
||||
<< "test=test" << std::endl;
|
||||
{
|
||||
std::stringstream ins;
|
||||
ins << "[Desktop Entry]]" << std::endl
|
||||
<< "test=test" << std::endl;
|
||||
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
}
|
||||
|
||||
// also test for brokenness in a later section, as the first section is normally treated specially
|
||||
{
|
||||
std::stringstream ins;
|
||||
ins << "[Desktop Entry]" << std::endl
|
||||
<< "test=test" << std::endl
|
||||
<< "[Another Section]]" << std::endl;
|
||||
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DesktopFileReaderFixture, testReadBrokenSectionHeaderTooManyOpeningBrackets) {
|
||||
std::stringstream ins;
|
||||
ins << "[[Desktop Entry]" << std::endl
|
||||
<< "test=test" << std::endl;
|
||||
{
|
||||
std::stringstream ins;
|
||||
ins << "[[Desktop Entry]" << std::endl
|
||||
<< "test=test" << std::endl;
|
||||
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
}
|
||||
|
||||
// also test for brokenness in a later section, as the first section is normally treated specially
|
||||
{
|
||||
std::stringstream ins;
|
||||
ins << "[Desktop Entry]" << std::endl
|
||||
<< "test=test" << std::endl
|
||||
<< "[[Another Section]";
|
||||
|
||||
ASSERT_THROW(DesktopFileReader reader(ins), ParseError);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user