diff options
author | polwex <polwex@sortug.com> | 2025-10-07 00:35:49 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-10-07 00:35:49 +0700 |
commit | a9f0e90099468ac9e4e2edf22fe8987856c8b6f6 (patch) | |
tree | 3a35e818063a14b9778002d8ba98a6769c410b07 /vere/pkg | |
parent | be60f97a3965b70ff8e8e6d8d4326b13fa9acb56 (diff) |
moar tests...
Diffstat (limited to 'vere/pkg')
-rw-r--r-- | vere/pkg/vere/test_slots.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vere/pkg/vere/test_slots.c b/vere/pkg/vere/test_slots.c new file mode 100644 index 0000000..7f7ab2f --- /dev/null +++ b/vere/pkg/vere/test_slots.c @@ -0,0 +1,30 @@ +/// Test slot extraction + +#include "noun.h" +#include "vere.h" + +int main(int argc, char* argv[]) +{ + u3C.wag_w |= u3o_hashless; + u3m_boot_lite(1 << 28); + + printf("Loading ivory.pill...\n"); + u3_noun ivory_jammed = u3m_file("/home/y/code/urbit/vere/ocaml/ivory.pill"); + u3_noun pil = u3ke_cue(ivory_jammed); + + printf("Pill mug: 0x%x\n", u3r_mug(pil)); + + // Extract core (tail of pill) + u3_noun core = u3t(pil); + printf("Core mug: 0x%x\n", u3r_mug(core)); + + // Extract slot 2 (head) + u3_noun slot2 = u3r_at(2, core); + printf("Slot 2 (head) mug: 0x%x\n", u3r_mug(slot2)); + + // Extract slot 3 (tail) + u3_noun slot3 = u3r_at(3, core); + printf("Slot 3 (tail) mug: 0x%x\n", u3r_mug(slot3)); + + return 0; +} |