Test impact on Pair of being Formattable
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1099414 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f1db2dda80
commit
7699d19aaa
|
@ -105,5 +105,17 @@ public class PairTest {
|
|||
Pair<String, Calendar> pair = Pair.of("DOB", date);
|
||||
assertEquals("Test created on " + "04-25-2011", pair.toString("Test created on %2$tm-%2$td-%2$tY"));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testFormattable_simple() throws Exception {
|
||||
Pair<String, String> pair = Pair.of("Key", "Value");
|
||||
assertEquals("(Key,Value)", String.format("%1$s", pair));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormattable_padded() throws Exception {
|
||||
Pair<String, String> pair = Pair.of("Key", "Value");
|
||||
assertEquals(" (Key,Value)", String.format("%1$20s", pair));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue