Skip to content

Commit 51a1c05

Browse files
committed
Add an empty test to check the simplest XML format for an Ssurgeon operation
1 parent da5199e commit 51a1c05

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/SsurgeonTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static org.junit.Assert.*;
44

55
import java.util.Collection;
6+
import java.util.List;
67

78
import org.junit.Test;
89

@@ -14,6 +15,21 @@
1415

1516
public class SsurgeonTest {
1617

18+
@Test
19+
public void readXMLEmptyPattern() {
20+
String newline = System.getProperty("line.separator");
21+
String doc = String.join(newline,
22+
"<ssurgeon-pattern-list>",
23+
" <ssurgeon-pattern>",
24+
" <uid>37</uid>",
25+
" <notes>This is a simple test</notes>",
26+
" <semgrex>{}=a1 &gt;appos=e1 {}=a2 &lt;nsubj=e2 {}=a3</semgrex>",
27+
" </ssurgeon-pattern>",
28+
"</ssurgeon-pattern-list>");
29+
Ssurgeon inst = Ssurgeon.inst();
30+
List<SsurgeonPattern> pattern = inst.readFromString(doc);
31+
}
32+
1733
/**
1834
* Simple test of an Ssurgeon edit script. This instances a simple semantic graph,
1935
* a semgrex pattern, and then the resulting actions over the named nodes in the

0 commit comments

Comments
 (0)