diff --git a/test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java b/test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java index 3c2b785f34..e19e27d007 100644 --- a/test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java +++ b/test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java @@ -222,6 +222,21 @@ public void testNegatedRegex() { "ate", "blueberry"); } + public void testBrokenContainsExpression() { + try { + // word is a String, not a Map, so this should throw a parse exception + SemgrexPattern pattern = SemgrexPattern.compile("{word@foo=bar}"); + throw new AssertionError("Expected a SemgrexParseException"); + } catch (SemgrexParseException e) { + // good + } + } + + public void testContainsExpression() { + // morphofeatures is a Map, so this should work + //SemgrexPattern pattern = SemgrexPattern.compile("{morphofeatures@foo=bar}"); + } + public void testReferencedRegex() { runTest("{word:/Bill/}", "[ate subj>Bill obj>[bill det>the]]", "Bill");