aboutsummaryrefslogtreecommitdiff
path: root/test/unit/trie.cc
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2023-12-12 21:27:08 +0100
committerRodrigo Arias Mallo <rodrigo.arias@bsc.es>2023-12-21 01:05:58 +0100
commit1da1260af72b20126176e2b8f73f7b7fd5952ce1 (patch)
tree0fcdb276d30814ce4075f7cc205e357b2b7c1be5 /test/unit/trie.cc
parent78ad5bfe9644d1217f9d9ad0bf2fcdc388551113 (diff)
Split tests into unit and dw (graphical)
Graphical tests for the dw (Dillo Widget) are moved to test/dw, while unit tests are placed into test/unit. All tests are compiled with "make check" but only the tests that can run without intervention and without a graphic display are executed.
Diffstat (limited to 'test/unit/trie.cc')
-rw-r--r--test/unit/trie.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/trie.cc b/test/unit/trie.cc
new file mode 100644
index 00000000..41b56c70
--- /dev/null
+++ b/test/unit/trie.cc
@@ -0,0 +1,14 @@
+#include "../dw/hyphenator.hh"
+
+int main (int argc, char *argv[])
+{
+ if (argc < 2) {
+ fprintf(stderr, "Usage: trie <pattern file>\n");
+ exit (1);
+ }
+
+ /* Use pack = 1024 to create a really small trie - can take a while.
+ */
+ dw::Hyphenator hyphenator (argv[1], NULL, 1024);
+ hyphenator.saveTrie (stdout);
+}