Skip to content

Commit dd54bf1

Browse files
build: add ppx_inline_test and inline test for external deps
Co-authored-by: aider (openai//workspace/models/openai-mirror/gpt-oss-120b/) <aider@aider.chat>
1 parent 6380a02 commit dd54bf1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(library
22
(name dune_ai_context)
3-
(libraries str unix compiler-libs.common sexplib))
3+
(libraries str unix compiler-libs.common sexplib ppx_inline_test))

lib/dune_ai_context.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,13 @@ let print_vendor_dependencies () =
119119
Format.printf "%a\n" Printtyp.signature cmi.cmi_sign)
120120
cmi_paths)
121121
deps
122+
123+
(* Inline test for [extract_external_deps] *)
124+
let%test "extract_external_deps parses external_deps correctly" =
125+
let s =
126+
"(default\n ((library\n ((names (inst))\n (extensions ())\n (package (inst))\n (source_dir lib)\n (external_deps\n ((core required)\n (str required)\n (ppx_jane required)\n (ppx_deriving_yojson required)))\n (internal_deps ())))))"
127+
in
128+
let sexp = Sexplib.Sexp.of_string s in
129+
let deps = extract_external_deps sexp in
130+
let expected = ["core"; "str"; "ppx_jane"; "ppx_deriving_yojson"] in
131+
List.sort String.compare deps = List.sort String.compare expected

0 commit comments

Comments
 (0)