Replace text directionality control characters with escape sequences in the semantics_tester (#93034)
This commit is contained in:
parent
773789344e
commit
0d0b2dbae5
@ -635,12 +635,9 @@ class SemanticsTester {
|
||||
if (nodeData.actions != 0)
|
||||
buf.writeln(' actions: ${_actionsToSemanticsActionExpression(nodeData.actions)},');
|
||||
if (node.label != null && node.label.isNotEmpty) {
|
||||
final String escapedLabel = node.label.replaceAll('\n', r'\n');
|
||||
if (escapedLabel != node.label) {
|
||||
buf.writeln(" label: r'$escapedLabel',");
|
||||
} else {
|
||||
buf.writeln(" label: '$escapedLabel',");
|
||||
}
|
||||
// Escape newlines and text directionality control characters.
|
||||
final String escapedLabel = node.label.replaceAll('\n', r'\n').replaceAll('\u202a', r'\u202a').replaceAll('\u202c', r'\u202c');
|
||||
buf.writeln(" label: '$escapedLabel',");
|
||||
}
|
||||
if (node.value != null && node.value.isNotEmpty)
|
||||
buf.writeln(" value: '${node.value}',");
|
||||
|
@ -132,7 +132,7 @@ void _tests() {
|
||||
tags: <SemanticsTag>[const SemanticsTag('RenderViewport.twoPane')],
|
||||
flags: <SemanticsFlag>[SemanticsFlag.hasCheckedState, SemanticsFlag.isChecked, SemanticsFlag.isSelected],
|
||||
actions: <SemanticsAction>[SemanticsAction.tap, SemanticsAction.decrease],
|
||||
label: 'Interactive text',
|
||||
label: '\u202aInteractive text\u202c',
|
||||
value: 'test-value',
|
||||
increasedValue: 'test-increasedValue',
|
||||
decreasedValue: 'test-decreasedValue',
|
||||
|
Loading…
x
Reference in New Issue
Block a user