# ZON test suite and formal specification

**URL:** <https://ziggit.dev/t/zon-test-suite-and-formal-specification/17715>\
**Category:** Help\
**Tags:** testing, zon\
**Created:** [September 25, 2026, 7:30pm UTC](https://ziggit.dev/t/zon-test-suite-and-formal-specification/17715 "2026-09-25T19:30:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jassielof](https://ziggit.dev/user_avatar/ziggit.dev/jassielof/32/9676_2.png) [@jassielof](https://ziggit.dev/u/jassielof)\
**Post date:** [September 25, 2026, 7:30pm UTC](https://ziggit.dev/t/zon-test-suite-and-formal-specification/17715/1 "2026-09-25T19:30:23Z")

</div>

I have implemented a ZON library in TypeScript (published on JSR) and would like to verify its correctness. Is there a test suite for ZON, similar to YAML’s or TOML’s? Is there also a formal spec., or at least an ongoing draft to be published once Zig reaches 1.0?

I know that there is a ZON module in the std. lib. and an open issue about adding ZON documentation, but neither seems to cover a test suite or a spec.

---

<div class="post-metadata">

**Author:** ![Southporter](https://ziggit.dev/user_avatar/ziggit.dev/southporter/32/2500_2.png) [@Southporter](https://ziggit.dev/u/Southporter)\
**Post date:** [September 25, 2026, 9:00pm UTC](https://ziggit.dev/t/zon-test-suite-and-formal-specification/17715/2 "2026-09-25T21:00:10Z")

</div>

I don’t believe there is an official spec right now. Zon is a subset of the Zig grammar, so I don’) think they will put a full spec until the compiler reaches 1.0. The only test suite would be in the compiler source code in [this folder](https://codeberg.org/ziglang/zig/src/branch/master/lib/std/zon).

For example, zon struct tests are found here: [https://codeberg.org/ziglang/zig/src/commit/7cef4755c33ca77137fb7e4d83146e27b5703685/lib/std/zon/parse.zig#L1537](https://codeberg.org/ziglang/zig/src/commit/7cef4755c33ca77137fb7e4d83146e27b5703685/lib/std/zon/parse.zig#L1537)

---

<div class="post-metadata">

**Author:** ![BratishkaErik](https://ziggit.dev/user_avatar/ziggit.dev/bratishkaerik/32/1222_2.png) [@BratishkaErik](https://ziggit.dev/u/BratishkaErik)\
**Post date:** [September 26, 2026, 8:33am UTC](https://ziggit.dev/t/zon-test-suite-and-formal-specification/17715/3 "2026-09-26T08:33:54Z")

</div>

There are also example syntax in “[test/behavior/zon](https://codeberg.org/ziglang/zig/src/tag/0.16.0/test/behavior/zon)” and “[test/behavior/zon.zig](https://codeberg.org/ziglang/zig/src/tag/0.16.0/test/behavior/zon.zig)”.

---

<div class="post-metadata">

**Author:** ![nurulhudaapon](https://ziggit.dev/user_avatar/ziggit.dev/nurulhudaapon/32/5148_2.png) [@nurulhudaapon](https://ziggit.dev/u/nurulhudaapon)\
**Post date:** [September 27, 2026, 6:11am UTC](https://ziggit.dev/t/zon-test-suite-and-formal-specification/17715/4 "2026-09-27T06:11:34Z")

</div>

I had built the same, and a small test suit that covers most major areas.

> **[zzon/test at main · nurulhudaapon/zzon](https://github.com/nurulhudaapon/zzon/tree/main/test)**
>
> A fast, spec compliant, ZON parser and serializer for JavaScript. - nurulhudaapon/zzon

---

<div class="post-metadata">

**Author:** ![jassielof](https://ziggit.dev/user_avatar/ziggit.dev/jassielof/32/9676_2.png) [@jassielof](https://ziggit.dev/u/jassielof)\
**Post date:** [September 27, 2026, 12:13pm UTC](https://ziggit.dev/t/zon-test-suite-and-formal-specification/17715/5 "2026-09-27T12:13:09Z")

</div>

The behavioral and module tests could work, though I was hoping for an agnostic suite. That doesn’t seem to be the case, nor with the formal specification. Anyway, thanks!

Might as well benchmark it against the ZZON one.
