mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-07-14 15:02:50 +03:00
Huge RichText refactor to improve inline-box support. Still WIP.
This commit is contained in:
@@ -658,12 +658,14 @@ UTEST( UITextNode_RichTextRebuild, MixedContentAppearsInRichText ) {
|
||||
UIRichText* rt = sceneNode->find<UIRichText>( "rt" );
|
||||
ASSERT_TRUE( rt != nullptr );
|
||||
|
||||
int textBlocks = 0;
|
||||
for ( const auto& block : rt->getRichTextPtr()->getBlocks() ) {
|
||||
if ( std::holds_alternative<RichText::SpanBlock>( block ) )
|
||||
textBlocks++;
|
||||
int textSpans = 0;
|
||||
for ( const auto& line : rt->getRichTextPtr()->getLines() ) {
|
||||
for ( const auto& span : line.spans ) {
|
||||
if ( span.type == RichText::RenderSpan::Type::Text )
|
||||
textSpans++;
|
||||
}
|
||||
}
|
||||
EXPECT_GE( textBlocks, 3 ); // "before ", "bold", " after"
|
||||
EXPECT_GE( textSpans, 3 ); // "before ", "bold", " after"
|
||||
|
||||
destroyRichTextScene( sceneNode );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user