Пример #1
0
 /** format for BigDecimal */
 @Test
 public void bigdecimal() {
   String value = Difference.format(new BigDecimal("0.000000000000000000000001"));
   assertThat(value, is("0.000000000000000000000001"));
 }
Пример #2
0
 /** format for String with meta characters. */
 @Test
 public void string_escape() {
   String value = Difference.format("\t\r\n\"\\");
   assertThat(value, is("\"\\t\\r\\n\\\"\\\\\""));
 }
Пример #3
0
 /** format for Calendar. */
 @Test
 public void calendar() {
   String value = Difference.format(new GregorianCalendar(2011, 1, 2, 13, 10, 15));
   assertThat(value, is("2011-02-02 13:10:15"));
 }
Пример #4
0
 /** format for String. */
 @Test
 public void string() {
   String value = Difference.format("hoge");
   assertThat(value, is("\"hoge\""));
 }