mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-30 19:05:36 -04:00
[libcalamares Expand tests
This commit is contained in:
parent
b144d81979
commit
319a720d1b
1 changed files with 14 additions and 0 deletions
|
@ -562,6 +562,20 @@ LibCalamaresTests::testStringTruncation()
|
||||||
cDebug() << "Result-line" << Logger::Quote << s;
|
cDebug() << "Result-line" << Logger::Quote << s;
|
||||||
QCOMPARE( s.count( '\n' ), 4 );
|
QCOMPARE( s.count( '\n' ), 4 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lines at both ends
|
||||||
|
{
|
||||||
|
auto s = truncateMultiLine( longString, LinesStartEnd { 2, 2 }, CharCount { sufficientLength } );
|
||||||
|
QVERIFY( s.length() > 1 );
|
||||||
|
cDebug() << "Result-line" << Logger::Quote << s;
|
||||||
|
QCOMPARE( s.count( '\n' ), 4 );
|
||||||
|
|
||||||
|
auto firsttwo = truncateMultiLine( s, LinesStartEnd { 2, 0 }, CharCount { sufficientLength } );
|
||||||
|
auto lasttwo = truncateMultiLine( s, LinesStartEnd { 0, 2 }, CharCount { sufficientLength } );
|
||||||
|
QCOMPARE( firsttwo + lasttwo, s );
|
||||||
|
QVERIFY( longString.startsWith( firsttwo ) );
|
||||||
|
QVERIFY( longString.endsWith( lasttwo ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue