File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
main/kotlin/org/projectfluent/syntax/processor
test/kotlin/org/projectfluent/syntax/processor Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class Processor {
37
37
when (element) {
38
38
is TextElement -> {
39
39
if (lastText == null ) {
40
- lastText = element
40
+ lastText = TextElement ( element.value)
41
41
} else {
42
42
lastText?.let { it.value + = element.value }
43
43
}
Original file line number Diff line number Diff line change @@ -32,6 +32,26 @@ internal class ProcessorTest {
32
32
processor.unescapeLiteralsToText(pattern)
33
33
)
34
34
35
+ pattern.elements.clear()
36
+ pattern.elements.addAll(
37
+ arrayOf(
38
+ TextElement (" Foo " ),
39
+ Placeable (expression = StringLiteral (" Bar" ))
40
+ )
41
+ )
42
+ assertEquals(
43
+ Pattern (TextElement (" Foo Bar" )),
44
+ processor.unescapeLiteralsToText(pattern)
45
+ )
46
+ // The original Pattern isn't modified.
47
+ assertEquals(
48
+ Pattern (
49
+ TextElement (" Foo " ),
50
+ Placeable (expression = StringLiteral (" Bar" ))
51
+ ),
52
+ pattern
53
+ )
54
+
35
55
pattern.elements.clear()
36
56
pattern.elements.addAll(
37
57
arrayOf(
You can’t perform that action at this time.
0 commit comments