Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 4298f05

Browse files
committed
filter: add test for a different thread
Signed-off-by: Alexander Bezzubov <[email protected]>
1 parent 22d65c7 commit 4298f05

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/scala/org/bblfsh/client/v2/BblfshClientUastApiTest.scala

+16
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,20 @@ class BblfshClientUastApiTest extends BblfshClientBaseTest {
104104

105105
// TODO(bzz): add test for multi-thread filtering
106106

107+
"XPath query" should "work another thread" in {
108+
val ctx = resp.uast.decode()
109+
val root = ctx.root()
110+
val th = new Thread(new Runnable {
111+
def run() {
112+
val filtered = root.filter("//*[@role='Type']")
113+
filtered.toSeq should have size (1)
114+
}
115+
})
116+
th.start
117+
118+
th.synchronized {
119+
th.wait
120+
}
121+
}
122+
107123
}

0 commit comments

Comments
 (0)