X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Futil%2FPlatformTest.java;h=8794b12d000bd861d8bd9750694cc809c2a4ca35;hb=614e136583b401b4273d92723fec158d84d4cb52;hp=d2c48f16e288aa1f1ba98d4d449a94a8bd3a424c;hpb=6853a22b51420bcea0fe12932d8850ffb30d9844;p=jalview.git diff --git a/test/jalview/util/PlatformTest.java b/test/jalview/util/PlatformTest.java index d2c48f1..8794b12 100644 --- a/test/jalview/util/PlatformTest.java +++ b/test/jalview/util/PlatformTest.java @@ -32,6 +32,7 @@ import java.awt.Toolkit; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; +import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -139,6 +140,20 @@ public class PlatformTest { assertNull(Platform.escapeBackslashes(null)); assertEquals(Platform.escapeBackslashes("hello world"), "hello world"); - assertEquals(Platform.escapeBackslashes("hello\\world"), "hello\\\\world"); + assertEquals(Platform.escapeBackslashes("hello\\world"), + "hello\\\\world"); + } + + @Test(groups = { "Functional" }) + public void getLeadingIntegerFromString() + { + Assert.assertEquals(Platform.getLeadingIntegerValue("1234abcd", -1), + 1234); + Assert.assertEquals(Platform.getLeadingIntegerValue("1234", -1), 1234); + Assert.assertEquals(Platform.getLeadingIntegerValue("abcd", -1), -1); + Assert.assertEquals(Platform.getLeadingIntegerValue("abcd1234", -1), + -1); + Assert.assertEquals(Platform.getLeadingIntegerValue("None", -1), -1); + Assert.assertEquals(Platform.getLeadingIntegerValue("Null", -1), -1); } }