X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Futil%2FPlatformTest.java;fp=test%2Fjalview%2Futil%2FPlatformTest.java;h=49f13351c514615f71edca960e571634d34603af;hb=4898f0ae429e0c61ddba72ca46be89b34bb4df8b;hp=d2c48f16e288aa1f1ba98d4d449a94a8bd3a424c;hpb=5a6ac5b535856903629234ad43a71319a91ebee5;p=jalview.git diff --git a/test/jalview/util/PlatformTest.java b/test/jalview/util/PlatformTest.java index d2c48f1..49f1335 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; @@ -141,4 +142,17 @@ public class PlatformTest 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); + } }