Skip to content

Commit 346259c

Browse files
committed
Fix a buggy test for broken semgrex contains features
1 parent b5719a2 commit 346259c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,16 @@ public void testNegatedRegex() {
227227
public void testBrokenContainsExpression() {
228228
try {
229229
// word is a String, not a Map, so this should throw a parse exception
230-
SemgrexPattern pattern = SemgrexPattern.compile("{word{foo=bar}}");
230+
SemgrexPattern pattern = SemgrexPattern.compile("{word:{foo:bar}}");
231231
throw new AssertionError("Expected a SemgrexParseException");
232232
} catch (SemgrexParseException e) {
233233
// good
234234
}
235+
236+
// this one should work. we run it here to verify the test was
237+
// valid, as opposed to getting a SemgrexParseException because
238+
// this wasn't even following proper contains syntax
239+
SemgrexPattern pattern = SemgrexPattern.compile("{morphofeatures:{foo:bar}}");
235240
}
236241

237242
public void testContainsExpression() {

0 commit comments

Comments
 (0)