1. write OCaml inline test
  2. run it
  3. if output is proper, run dune promote to accept result

command

# 分成兩步驟
dune test
dune promote
# 或是測試後直接更新
dune test --auto-promote

OCaml code

let%expect_test "atest" =
  print_int 1;
  [%expect {||}]

Dune config

(library
 (name xxx)
 (inline_tests)
 (preprocess
  (pps ppx_expect))
 (libraries))