Skip to content

Commit 8ccb8a9

Browse files
committed
Add test case for multiple failing escapes
1 parent 86a0ae8 commit 8ccb8a9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/test/java/org/codehaus/plexus/interpolation/multi/MultiDelimiterStringSearchInterpolatorTest.java

+19
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,23 @@ public void testSuccessiveInterpolationWithDifferentDelimiters_ReversedDelimiter
6666
assertEquals( ctx.get( "name" ), result );
6767
}
6868

69+
public void testInterpolationWithMultipleEscapes()
70+
throws InterpolationException
71+
{
72+
Map ctx = new HashMap();
73+
ctx.put( "name", "User" );
74+
ctx.put( "otherName", "##${first} and #${last}" );
75+
76+
String input = "${otherName}";
77+
78+
ValueSource vs = new MapBasedValueSource( ctx );
79+
MultiDelimiterStringSearchInterpolator interpolator = new MultiDelimiterStringSearchInterpolator()
80+
.withValueSource( vs );
81+
interpolator.setEscapeString("#");
82+
83+
String result = interpolator.interpolate( input );
84+
85+
assertEquals( "#${first} and ${last}", result );
86+
}
87+
6988
}

0 commit comments

Comments
 (0)