comparison test/org/tmatesoft/hg/test/TestAuxUtilities.java @ 363:d9dfa9fe9cec

Decode escape sequences in changeset extras field
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 09 Dec 2011 02:08:09 +0100
parents 5f9073eabf06
children 2fadf8695f8a
comparison
equal deleted inserted replaced
362:4937e35b805b 363:d9dfa9fe9cec
287 } 287 }
288 Assert.assertFalse(p.hasDefault() ^ p.getDefault() != null); 288 Assert.assertFalse(p.hasDefault() ^ p.getDefault() != null);
289 Assert.assertFalse(p.hasDefaultPush() ^ p.getDefaultPush() != null); 289 Assert.assertFalse(p.hasDefaultPush() ^ p.getDefaultPush() != null);
290 } 290 }
291 291
292 @Test
293 public void testChangelogExtrasDecode() {
294 final String s = "abc\u0123\r\ndef\n\txx\\yy";
295 String r = s.replace("\\", "\\\\").replace("\n", "\\n").replace("\r", "\\r").replace("\0", "\\0");
296 // System.out.println(r);
297 String r2 = r.replace("\\\\", "\\").replace("\\n", "\n").replace("\\r", "\r").replace("\\0", "\00");
298 // System.out.println(r2);
299 Assert.assertTrue(s.equals(r2));
300 }
301
302
292 public static void main(String[] args) throws Exception { 303 public static void main(String[] args) throws Exception {
293 new TestAuxUtilities().testRepositoryConfig(); 304 new TestAuxUtilities().testRepositoryConfig();
294 } 305 }
295 } 306 }