summaryrefslogtreecommitdiff
path: root/ocaml/test/test_dill_iris.ml
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-06 23:18:59 +0700
committerpolwex <polwex@sortug.com>2025-10-06 23:18:59 +0700
commit5de3f7a3ad7b0cf63b4a6cbddfc1e26359dea161 (patch)
treeb55b2258123149bed40bd89bbaa58e7da54f3a26 /ocaml/test/test_dill_iris.ml
parentfdab65f6dac4ba85ed4749f61970660d1132d453 (diff)
cleaned up tests
Diffstat (limited to 'ocaml/test/test_dill_iris.ml')
-rw-r--r--ocaml/test/test_dill_iris.ml98
1 files changed, 0 insertions, 98 deletions
diff --git a/ocaml/test/test_dill_iris.ml b/ocaml/test/test_dill_iris.ml
deleted file mode 100644
index ed974ae..0000000
--- a/ocaml/test/test_dill_iris.ml
+++ /dev/null
@@ -1,98 +0,0 @@
-(* Test Dill and Iris Drivers *)
-
-open Io_drivers
-
-let test_dill_creation _env =
- Printf.printf "Test: Dill driver creation...\n";
-
- let config = Dill.{
- prompt = "~zod:dojo>";
- } in
-
- let dill = Dill.create config in
- let stats = Dill.get_stats dill in
-
- Printf.printf " Created Dill driver with prompt: %s\n" config.prompt;
- Printf.printf " Initial stats - lines read: %Ld, written: %Ld\n"
- stats.lines_read stats.lines_written;
-
- assert (stats.lines_read = 0L);
- assert (stats.lines_written = 0L);
-
- Printf.printf " āœ“ Dill driver creation works!\n\n"
-
-let test_dill_output env =
- Printf.printf "Test: Dill terminal output...\n";
-
- let config = Dill.{
- prompt = "~zod:dojo>";
- } in
-
- let dill = Dill.create config in
-
- (* Write some output *)
- Dill.write_output dill ~env "Hello from Dill!\n";
- Dill.write_output dill ~env "Terminal output is working!\n";
-
- let stats = Dill.get_stats dill in
- Printf.printf " Stats - lines written: %Ld, bytes written: %Ld\n"
- stats.lines_written stats.bytes_written;
-
- assert (stats.lines_written = 2L);
-
- Printf.printf " āœ“ Terminal output works!\n\n"
-
-let test_iris_creation _env =
- Printf.printf "Test: Iris driver creation...\n";
-
- let iris = Iris.create () in
- let stats = Iris.get_stats iris in
-
- Printf.printf " Created Iris HTTP client driver\n";
- Printf.printf " Initial stats - requests: %Ld, active: %d\n"
- stats.requests_total stats.requests_active;
-
- assert (stats.requests_total = 0L);
- assert (stats.requests_active = 0);
-
- Printf.printf " āœ“ Iris driver creation works!\n\n"
-
-let test_iris_url_parsing _env =
- Printf.printf "Test: URL parsing...\n";
-
- let test_cases = [
- ("http://example.com/path", "example.com", "/path");
- ("https://api.github.com/users", "api.github.com", "/users");
- ("http://localhost", "localhost", "/");
- ] in
-
- List.iter (fun (url, expected_host, expected_path) ->
- let (host, path) = Iris.parse_url url in
- Printf.printf " URL: %s -> host: %s, path: %s\n" url host path;
- assert (host = expected_host);
- assert (path = expected_path)
- ) test_cases;
-
- Printf.printf " āœ“ URL parsing works!\n\n"
-
-let () =
- Printf.printf "\nšŸš€šŸš€šŸš€ === DILL & IRIS TESTS === šŸš€šŸš€šŸš€\n\n";
-
- Eio_main.run @@ fun env ->
- test_dill_creation env;
- test_dill_output env;
- test_iris_creation env;
- test_iris_url_parsing env;
-
- Printf.printf "šŸŽ‰šŸŽ‰šŸŽ‰ === ALL DILL & IRIS TESTS PASSED! === šŸŽ‰šŸŽ‰šŸŽ‰\n\n";
- Printf.printf "Terminal and HTTP client drivers are working!\n";
- Printf.printf "\nDill (Terminal):\n";
- Printf.printf "- Driver creation āœ“\n";
- Printf.printf "- Terminal output āœ“\n";
- Printf.printf "- Async I/O ready for input fiber āœ“\n";
- Printf.printf "\nIris (HTTP Client):\n";
- Printf.printf "- Driver creation āœ“\n";
- Printf.printf "- URL parsing āœ“\n";
- Printf.printf "- Async HTTP requests ready āœ“\n";
- Printf.printf "\nšŸŽ‰ ALL I/O DRIVERS COMPLETE! šŸŽ‰\n";
- Printf.printf "Ready to run a full Arvo kernel!\n"