summaryrefslogtreecommitdiff
path: root/llama.cpp/tests/test-peg-parser.cpp
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-02-12 20:57:17 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-02-12 20:57:17 +0100
commitb333b06772c89d96aacb5490d6a219fba7c09cc6 (patch)
tree211df60083a5946baa2ed61d33d8121b7e251b06 /llama.cpp/tests/test-peg-parser.cpp
downloadllmnpc-b333b06772c89d96aacb5490d6a219fba7c09cc6.tar.gz
Engage!
Diffstat (limited to 'llama.cpp/tests/test-peg-parser.cpp')
-rw-r--r--llama.cpp/tests/test-peg-parser.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/llama.cpp/tests/test-peg-parser.cpp b/llama.cpp/tests/test-peg-parser.cpp
new file mode 100644
index 0000000..220745d
--- /dev/null
+++ b/llama.cpp/tests/test-peg-parser.cpp
@@ -0,0 +1,25 @@
+#include <cstdlib>
+#include <string>
+#include <iostream>
+
+#include "peg-parser/tests.h"
+
+int main(int argc, char *argv[]) {
+ testing t(std::cout);
+ if (argc >= 2) {
+ t.set_filter(argv[1]);
+ }
+
+ const char * verbose = getenv("LLAMA_TEST_VERBOSE");
+ if (verbose) {
+ t.verbose = std::string(verbose) == "1";
+ }
+
+ t.test("basic", test_basic);
+ t.test("unicode", test_unicode);
+ t.test("json", test_json_parser);
+ t.test("gbnf", test_gbnf_generation);
+ t.test("serialization", test_json_serialization);
+
+ return t.summary();
+}