Skip to content

Commit

Permalink
Unused decls: more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kakadu <[email protected]>
  • Loading branch information
Kakadu committed Jul 20, 2024
1 parent 10d47da commit e94c70c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions tests/unused_func/Simple.t/custom_demo.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = print_int (Custom_lib.Custom_lib_impl.incr 41)
1 change: 1 addition & 0 deletions tests/unused_func/Simple.t/custom_lib_impl.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let incr n = n+1
1 change: 1 addition & 0 deletions tests/unused_func/Simple.t/custom_lib_impl.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
val incr : int -> int
17 changes: 12 additions & 5 deletions tests/unused_func/Simple.t/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
SecondTU
;
)
; (flags
; (:standard -dtypedtree))
(inline_tests)
(preprocess
(pps ppx_expect ppx_inline_test))
;(libraries base angstrom)
)
(pps ppx_expect ppx_inline_test)))

(library
(name custom_lib)
(public_name Simple.Custom)
;(package Simple)
(modules custom_lib_impl))

(executable
(name custom_demo)
(modules custom_demo)
(libraries custom_lib))
3 changes: 3 additions & 0 deletions tests/unused_func/Simple.t/dune-project
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
(lang dune 2.8)

(cram enable)

(package
(name Simple))
5 changes: 4 additions & 1 deletion tests/unused_func/Simple.t/run.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
$ dune build
$ dune build @check
$ dune describe
$ zanuda -unused-decls .
module "Custom_lib" is omitted
unused decl: Simple.Meow.meow
unused decl: Simple.Meow.woof
unused decl: Custom_lib_impl.incr
# Custom_lib_impl.incr is not found because a custom public name for library 'custom_lib'

0 comments on commit e94c70c

Please sign in to comment.