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

Commit ea0de83

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

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

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

+16-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,21 @@ class BblfshClientUastApiTest extends BblfshClientBaseTest {
101101
it.close()
102102
it.hasNext should be(false)
103103
}
104-
105-
// TODO(bzz): add test for multi-thread filtering
104+
105+
"XPath query" should "work another thread" in {
106+
val ctx = resp.uast.decode()
107+
val root = ctx.root()
108+
val th = new Thread(new Runnable {
109+
def run() {
110+
val filtered = root.filter("//*[@role='Type']")
111+
filtered.toSeq should have size (1)
112+
}
113+
})
114+
th.start
115+
116+
th.synchronized {
117+
th.wait
118+
}
119+
}
106120

107121
}

0 commit comments

Comments
 (0)