blob: 832558946f4a7856f4efbe3b4765e8be1b788573 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
(* Test Real Arvo Execution
*
* Load ivory pill and try to poke Arvo with a test event
*)
open Nock_lib
let test_load_and_poke env =
Printf.printf "๐งช Testing Real Arvo Execution\n\n";
Eio.Switch.run @@ fun _sw ->
let fs = Eio.Stdenv.fs env in
(* Load ivory pill *)
Printf.printf "Loading ivory pill...\n%!";
let state = State.create () in
match Boot.boot_from_file ~fs state "ivory.pill" with
| Error msg ->
Printf.printf "โ Failed to load pill: %s\n%!" msg;
failwith "Pill load failed"
| Ok () ->
Printf.printf "โ Ivory kernel loaded!\n\n";
(* Create a simple test event (ovum) *)
Printf.printf "Creating test event...\n%!";
let test_event = Noun.cell
(Noun.atom 0) (* wire: simple routing *)
(Noun.cell
(Noun.atom 1) (* vane tag *)
(Noun.atom 42)) (* simple data *)
in
Printf.printf "Test event: [wire card]\n%!";
Printf.printf " wire: 0\n%!";
Printf.printf " card: [1 42]\n\n%!";
(* Try to poke Arvo! *)
Printf.printf "๐ Poking Arvo with test event...\n%!";
try
let start = Unix.gettimeofday () in
let effects = State.poke state test_event in
let elapsed = Unix.gettimeofday () -. start in
Printf.printf "โ Poke succeeded in %.4f seconds!\n\n" elapsed;
Printf.printf "Effects returned: %d\n%!" (List.length effects);
Printf.printf "New event number: %Ld\n\n%!" (State.event_num state);
Printf.printf "๐ ARVO IS RUNNING!\n%!";
with e ->
Printf.printf "โ Poke failed with exception:\n%!";
Printf.printf " %s\n\n%!" (Printexc.to_string e);
Printf.printf "This is expected - we need to figure out:\n%!";
Printf.printf " 1. Correct event format\n%!";
Printf.printf " 2. Correct poke formula\n%!";
Printf.printf " 3. How to parse results\n%!"
let () =
Printf.printf "\n";
Printf.printf "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ\n";
Printf.printf " Testing Real Arvo Execution with Ivory Pill\n";
Printf.printf "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ\n";
Printf.printf "\n";
Eio_main.run test_load_and_poke
|