MCPcopy Create free account
hub / github.com/BaseXdb/basex / texts

Method texts

basex-core/src/test/java/org/basex/util/CompressTest.java:78–95  ·  view source on GitHub ↗

Test on all text nodes of a document. @param file file to be parsed @throws Exception exception

(final String file)

Source from the content-addressed store, hash-verified

76 * @throws Exception exception
77 */
78 private static void texts(final String file) throws Exception {
79 final String query = "let $doc := doc('" + file + "')" +
80 "for $i in $doc//(@hohoho | text()) return data($i)";
81
82 final TokenList tl = new TokenList();
83 final TokenBuilder tb = new TokenBuilder();
84 try(QueryProcessor qp = new QueryProcessor(query, context)) {
85 final Iter iter = qp.iter();
86 for(Item item; (item = iter.next()) != null;) {
87 final byte[] token = item.string(null);
88 tl.add(token);
89 tb.add(token).add(' ');
90 }
91 }
92
93 run(tl.finish());
94 run(tb.finish());
95 }
96
97 /**
98 * Tests the correctness of the compressed tokens.

Callers 2

test7Method · 0.95
test8Method · 0.95

Calls 9

nextMethod · 0.95
stringMethod · 0.95
addMethod · 0.95
addMethod · 0.95
runMethod · 0.95
finishMethod · 0.95
iterMethod · 0.65
addMethod · 0.65
finishMethod · 0.45

Tested by

no test coverage detected