# \[ANN\] UnifiedScript\_{Std,Top} - literate testing

**URL:** <https://discuss.ocaml.org/t/ann-unifiedscript-std-top-literate-testing/18013>\
**Category:** Ecosystem\
**Tags:** dk, announce\
**Created:** [April 23, 2026, 12:05pm UTC](https://discuss.ocaml.org/t/ann-unifiedscript-std-top-literate-testing/18013 "2026-04-23T12:05:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbeckford](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jbeckford/32/3027_2.png) [@jbeckford](https://discuss.ocaml.org/u/jbeckford)\
**Post date:** [April 23, 2026, 12:05pm UTC](https://discuss.ocaml.org/t/ann-unifiedscript-std-top-literate-testing/18013/1 "2026-04-23T12:05:14Z")

</div>

I am pleased to introduce the `UnifiedScript_Std` and `UnifiedScript_Top` packages. Unified scripts are a way to write tests and documentation simultaneously. Cram tests and [MDX scripts](https://github.com/realworldocaml/mdx) are both similar to unified scripts, but unified scripts aren’t tied to Markdown (MDX) or tied to POSIX shell commands (cram tests).

Examples:

- _Markdown example_: Here are the zillions of tests from `ocaml-re` converted into Markdown: [ocaml-re/EXAMPLES.md](https://github.com/jonahbeckford/ocaml-re/blob/7dbfc446bd594303add00f443bdea206b08511c2/EXAMPLES.md). Custom OCaml REPL printers are used so that many of the tests are printed as Markdown tables. _aside: Wouldn’t it be nice if tests you are already writing became documentation? That was a 4 year follow-up to [What are the biggest reasons newcomers give up on OCaml? - #13 by jbeckford](https://discuss.ocaml.org/t/what-are-the-biggest-reasons-newcomers-give-up-on-ocaml/10958/13))_

- _`.ml` example_: The following is a snippet from [a regular OCaml `.ml` module](https://gitlab.com/dkml/build-tools/MlFront/-/blob/374bbac77003cd8cee56f0664cec974aa314c648/src/UnifiedScript_Top/plainmodule.ml) where the `(* ... *)` comments are OCaml REPL toplevel responses maintained by the unified tools.

Docs are at [dk/docs/UNIFIED\_SCRIPTS.md](https://github.com/diskuv/dk/blob/ffa130a1dbefcd134b0d15f112fd6d6c99dc0fc8/docs/UNIFIED_SCRIPTS.md) (of course generated by the unified tools).

Install the tools with:

```auto
opam pin add UnifiedScript_Std https://gitlab.com/dkml/build-tools/MlFront/-/releases/permalink/latest/downloads/MlFront.tar.gz
opam pin add UnifiedScript_Top https://gitlab.com/dkml/build-tools/MlFront/-/releases/permalink/latest/downloads/MlFront.tar.gz

```

After feedback I’ll release them officially to opam. I would like feedback overall and also specifically on the [agent skill that converts expect tests to unified tests](https://github.com/jonahbeckford/ocaml-re/blob/make-literate-tests/.claude/skills/make-literate-tests/SKILL.md).
