X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Futil%2FPlatformTest.java;fp=test%2Fjalview%2Futil%2FPlatformTest.java;h=d2c48f16e288aa1f1ba98d4d449a94a8bd3a424c;hb=4d08d42e4ac66d978ff1f2929797695cd5217102;hp=617bf42bd08995a027d167424290da2b5bfc79de;hpb=cc5380d16566728ce9af78e3b5be7a40c98c7b63;p=jalview.git diff --git a/test/jalview/util/PlatformTest.java b/test/jalview/util/PlatformTest.java index 617bf42..d2c48f1 100644 --- a/test/jalview/util/PlatformTest.java +++ b/test/jalview/util/PlatformTest.java @@ -20,7 +20,9 @@ */ package jalview.util; +import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; import jalview.gui.JvOptionPane; @@ -120,4 +122,23 @@ public class PlatformTest assertTrue(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0, 0, 0, clickCount, isPopupTrigger, buttonNo), mac)); } + + @Test(groups = "Functional") + public void testPathEquals() + { + assertTrue(Platform.pathEquals(null, null)); + assertFalse(Platform.pathEquals(null, "apath")); + assertFalse(Platform.pathEquals("apath", null)); + assertFalse(Platform.pathEquals("apath", "APATH")); + assertTrue(Platform.pathEquals("apath", "apath")); + assertTrue(Platform.pathEquals("apath/a/b", "apath\\a\\b")); + } + + @Test(groups = "Functional") + public void testEscapeBackslashes() + { + assertNull(Platform.escapeBackslashes(null)); + assertEquals(Platform.escapeBackslashes("hello world"), "hello world"); + assertEquals(Platform.escapeBackslashes("hello\\world"), "hello\\\\world"); + } }