Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ unreleased
as it is usually the common case and it helps when magic numbers are
ambiguous (such as on development versions) (#409, @shym)

- Remove unnecessary test dependencies towards base and stdio (#421, @kit-ty-kate)

0.29.1 (14/02/2023)
------------------

Expand Down
4 changes: 1 addition & 3 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
stdlib-shims
(ocamlfind :with-test)
(re (and :with-test (>= 1.9.0)))
(cinaps (and :with-test (>= v0.12.1)))
(base :with-test)
(stdio :with-test))
(cinaps (and :with-test (>= v0.12.1))))
(conflicts
(ocaml-migrate-parsetree (< 2.0.0))
base-effects)
Expand Down
2 changes: 0 additions & 2 deletions ppxlib.opam
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ depends: [
"ocamlfind" {with-test}
"re" {with-test & >= "1.9.0"}
"cinaps" {with-test & >= "v0.12.1"}
"base" {with-test}
"stdio" {with-test}
"odoc" {with-doc}
]
conflicts: [
Expand Down
21 changes: 8 additions & 13 deletions test/base/test.ml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#require "base";;
#require "stdio";;

let () = Printexc.record_backtrace false

open Base
open Stdio
open Ppxlib

module N = Ppxlib_private.Name
Expand All @@ -14,9 +9,9 @@ module N = Ppxlib.Ppxlib_private.Name


let dot_suffixes name =
Caml.Printf.sprintf "%s"
(Sexp.to_string_hum
(List.sexp_of_t String.sexp_of_t (N.dot_suffixes name)))
Printf.sprintf "%s"
(Sexplib0.Sexp.to_string_hum
(Sexplib0.Sexp_conv.sexp_of_list Sexplib0.Sexp_conv.sexp_of_string (N.dot_suffixes name)))
[%%expect{|
val dot_suffixes : string -> string = <fun>
|}]
Expand All @@ -34,9 +29,9 @@ let _ = dot_suffixes "[email protected]"

let split_path name =
let a, b = N.split_path name in
Caml.Printf.sprintf "%s"
(Sexp.to_string_hum
(List [sexp_of_string a; Option.sexp_of_t sexp_of_string b]))
Printf.sprintf "%s"
(Sexplib0.Sexp.to_string_hum
(List [Sexplib0.Sexp_conv.sexp_of_string a; Sexplib0.Sexp_conv.sexp_of_option Sexplib0.Sexp_conv.sexp_of_string b]))
[%%expect{|
val split_path : string -> string = <fun>
|}]
Expand Down Expand Up @@ -161,12 +156,12 @@ let _ =
let _ =
let open Ast_builder.Make (struct let loc = Location.none end) in
let params decl =
List.map decl.ptype_params ~f:(fun (core_type, _) -> core_type.ptyp_desc)
List.map (fun (core_type, _) -> core_type.ptyp_desc) decl.ptype_params
in
let decl =
type_declaration
~name:{ txt = "t"; loc = Location.none }
~params:(List.init 3 ~f:(fun _ -> ptyp_any, (NoVariance, NoInjectivity)))
~params:(List.init 3 (fun _ -> ptyp_any, (NoVariance, NoInjectivity)))
~cstrs:[]
~kind:Ptype_abstract
~private_:Public
Expand Down
21 changes: 9 additions & 12 deletions test/code_path/test.ml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
#require "base";;

open Base
open Ppxlib

let sexp_of_code_path code_path =
Sexp.message
Sexplib0.Sexp.message
"code_path"
[ "main_module_name", sexp_of_string (Code_path.main_module_name code_path)
; "submodule_path", sexp_of_list sexp_of_string (Code_path.submodule_path code_path)
; "enclosing_module", sexp_of_string (Code_path.enclosing_module code_path)
; "enclosing_value", sexp_of_option sexp_of_string (Code_path.enclosing_value code_path)
; "value", sexp_of_option sexp_of_string (Code_path.value code_path)
; "fully_qualified_path", sexp_of_string (Code_path.fully_qualified_path code_path)
[ "main_module_name", Sexplib0.Sexp_conv.sexp_of_string (Code_path.main_module_name code_path)
; "submodule_path", Sexplib0.Sexp_conv.sexp_of_list Sexplib0.Sexp_conv.sexp_of_string (Code_path.submodule_path code_path)
; "enclosing_module", Sexplib0.Sexp_conv.sexp_of_string (Code_path.enclosing_module code_path)
; "enclosing_value", Sexplib0.Sexp_conv.sexp_of_option Sexplib0.Sexp_conv.sexp_of_string (Code_path.enclosing_value code_path)
; "value", Sexplib0.Sexp_conv.sexp_of_option Sexplib0.Sexp_conv.sexp_of_string (Code_path.value code_path)
; "fully_qualified_path", Sexplib0.Sexp_conv.sexp_of_string (Code_path.fully_qualified_path code_path)
]

let () =
Expand All @@ -24,10 +21,10 @@ let () =
let loc = Expansion_context.Extension.extension_point_loc ctxt in
let code_path = Expansion_context.Extension.code_path ctxt in
Ast_builder.Default.estring ~loc
(Sexp.to_string (sexp_of_code_path code_path)))
(Sexplib0.Sexp.to_string (sexp_of_code_path code_path)))
]
[%%expect{|
val sexp_of_code_path : Code_path.t -> Sexp.t = <fun>
val sexp_of_code_path : Code_path.t -> Sexplib0.Sexp.t = <fun>
|}]

let s =
Expand Down
2 changes: 0 additions & 2 deletions test/deriving/test.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#require "base";;

open Ppxlib


Expand Down
2 changes: 0 additions & 2 deletions test/driver/attributes/test.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#require "base";;

open Stdppx
open Ppxlib

Expand Down
3 changes: 0 additions & 3 deletions test/driver/non-compressible-suffix/test.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#require "base";;
#require "stdio";;

open Ppxlib;;
open Ast_builder.Default;;

Expand Down
2 changes: 0 additions & 2 deletions test/quoter/test.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#require "base";;

open Ppxlib
open Expansion_helpers

Expand Down