From: Jim Procter Date: Tue, 9 May 2017 16:58:52 +0000 (+0100) Subject: JAL-2509 verify stockholm parser’s bracket regex is working for all WUSS notation X-Git-Tag: Release_2_10_2~3^2~88^2~10 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0cc7012545b54289025e8c6f109b4f26dc61dae9;hp=5edb9a0c935f7c153bbddedfe2ce36bb389dbb53;p=jalview.git JAL-2509 verify stockholm parser’s bracket regex is working for all WUSS notation --- diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index bd1400b..f6b39af 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -461,6 +461,20 @@ public class StockholmFileTest roundTripSSForRNA(aliFile, annFileFullWuss); } + @Test(groups = { "Functional" }) + public void detectWussBrackets() + { + for (char ch : new char[] { '{', '}', '[', ']', '(', ')', '<', '>' }) + { + Assert.assertTrue(StockholmFile.DETECT_BRACKETS.matchAt("" + ch, 0), + "Didn't recognise " + ch + " as a WUSS bracket"); + } + for (char ch : new char[] { '@', '!', 'V', 'Q', '*', ' ', '-', '.' }) + { + Assert.assertFalse(StockholmFile.DETECT_BRACKETS.matchAt("" + ch, 0), + "Shouldn't recognise " + ch + " as a WUSS bracket"); + } + } private static void roundTripSSForRNA(String aliFile, String annFile) throws Exception {