* @param seqName
* @return
*/
- private static String sanitizeSeqName(String seqName)
+ static String sanitizeSeqName(String seqName)
{
Objects.requireNonNull(seqName);
return seqName.replaceAll("\\[\\d*\\]", "")
assertTrue(sc.getDiscoveredStructuresSet().size() > 0);
}
+
+ @Test(groups = { "Functional" })
+ public void sanitizeSeqNameTest()
+ {
+ String name = "ab_cdEF|fwxyz012349";
+ assertEquals(name, StructureChooser.sanitizeSeqName(name));
+
+ // remove a [nn] substring
+ name = "abcde12[345]fg";
+ assertEquals("abcde12fg", StructureChooser.sanitizeSeqName(name));
+
+ // remove characters other than a-zA-Z0-9 | or _
+ name = "ab[cd],.\t£$*!- \\\"@:e";
+ assertEquals("abcde", StructureChooser.sanitizeSeqName(name));
+
+ name = "abcde12[345a]fg";
+ assertEquals("abcde12345afg", StructureChooser.sanitizeSeqName(name));
+ }
}