Skip to content

Commit

Permalink
Upgrade deps, split tests and use Expect_test_helpers_base
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbin committed Aug 23, 2024
1 parent 5cd8a53 commit a24d458
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 16 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.0.11 (2024-08-23)

### Changed

- Split test package and use `Expect_test_helpers_base`.
- Upgrade to `parsing-utils.0.0.8`.
- Upgrade to `err0.0.0.2` & `loc0.0.1.0`.

## 0.0.10 (2024-08-22)

### Changed
Expand Down
52 changes: 52 additions & 0 deletions auto-format-tests.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Tests for [Auto-format]"
maintainer: ["Mathieu Barbin"]
authors: ["Mathieu Barbin"]
license: "MIT"
homepage: "https://github.com/mbarbin/auto-format"
doc: "https://mbarbin.github.io/auto-format/"
bug-reports: "https://github.com/mbarbin/auto-format/issues"
depends: [
"dune" {>= "3.16"}
"ocaml" {>= "5.2"}
"auto-format" {= version}
"base" {>= "v0.17" & < "v0.18"}
"commandlang" {>= "0.0.2"}
"eio" {>= "1.0"}
"eio-writer" {>= "0.0.3"}
"eio_main" {>= "1.0"}
"expect_test_helpers_core" {>= "v0.17" & < "v0.18"}
"fpath" {>= "0.7.3"}
"fpath-base" {>= "0.0.9"}
"loc0" {>= "0.1.0"}
"parsing-utils" {>= "0.0.8"}
"pp" {>= "1.2.0"}
"pp-extended" {>= "0.0.2"}
"ppx_compare" {>= "v0.17" & < "v0.18"}
"ppx_enumerate" {>= "v0.17" & < "v0.18"}
"ppx_expect" {>= "v0.17" & < "v0.18"}
"ppx_hash" {>= "v0.17" & < "v0.18"}
"ppx_here" {>= "v0.17" & < "v0.18"}
"ppx_js_style" {dev & >= "v0.17" & < "v0.18"}
"ppx_let" {>= "v0.17" & < "v0.18"}
"ppx_sexp_conv" {>= "v0.17" & < "v0.18"}
"ppx_sexp_value" {>= "v0.17" & < "v0.18"}
"ppxlib" {>= "0.33"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/mbarbin/auto-format.git"
8 changes: 3 additions & 5 deletions auto-format.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@ depends: [
"dune" {>= "3.16"}
"ocaml" {>= "5.2"}
"base" {>= "v0.17" & < "v0.18"}
"commandlang" {>= "0.0.1"}
"commandlang" {>= "0.0.2"}
"eio" {>= "1.0"}
"eio-writer" {>= "0.0.3"}
"eio_main" {>= "1.0"}
"expect-test-helpers" {with-test & >= "v0.17" & < "v0.18"}
"fpath" {>= "0.7.3"}
"fpath-base" {>= "0.0.9"}
"loc" {>= "0.0.2"}
"parsing-utils" {>= "0.0.7"}
"loc0" {>= "0.1.0"}
"parsing-utils" {>= "0.0.8"}
"pp" {>= "1.2.0"}
"pp-extended" {>= "0.0.2"}
"ppx_compare" {>= "v0.17" & < "v0.18"}
"ppx_enumerate" {>= "v0.17" & < "v0.18"}
"ppx_expect" {with-test & >= "v0.17" & < "v0.18"}
"ppx_hash" {>= "v0.17" & < "v0.18"}
"ppx_here" {>= "v0.17" & < "v0.18"}
"ppx_js_style" {dev & >= "v0.17" & < "v0.18"}
Expand Down
80 changes: 73 additions & 7 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,93 @@
(>= v0.17)
(< v0.18)))
(commandlang
(>= 0.0.1))
(>= 0.0.2))
(eio
(>= 1.0))
(eio-writer
(>= 0.0.3))
(eio_main
(>= 1.0))
(expect-test-helpers
(fpath
(>= 0.7.3))
(fpath-base
(>= 0.0.9))
(loc0
(>= 0.1.0))
(parsing-utils
(>= 0.0.8))
(pp
(>= 1.2.0))
(pp-extended
(>= 0.0.2))
(ppx_compare
(and
(>= v0.17)
(< v0.18)))
(ppx_enumerate
(and
(>= v0.17)
(< v0.18)))
(ppx_hash
(and
(>= v0.17)
(< v0.18)))
(ppx_here
(and
(>= v0.17)
(< v0.18)))
(ppx_js_style
(and
:dev
(>= v0.17)
(< v0.18)))
(ppx_let
(and
(>= v0.17)
(< v0.18)))
(ppx_sexp_conv
(and
(>= v0.17)
(< v0.18)))
(ppx_sexp_value
(and
(>= v0.17)
(< v0.18)))
(ppxlib
(>= 0.33))))

(package
(name auto-format-tests)
(synopsis "Tests for [Auto-format]")
(depends
(ocaml
(>= 5.2))
(auto-format
(= :version))
(base
(and
(>= v0.17)
(< v0.18)))
(commandlang
(>= 0.0.2))
(eio
(>= 1.0))
(eio-writer
(>= 0.0.3))
(eio_main
(>= 1.0))
(expect_test_helpers_core
(and
:with-test
(>= v0.17)
(< v0.18)))
(fpath
(>= 0.7.3))
(fpath-base
(>= 0.0.9))
(loc
(>= 0.0.2))
(loc0
(>= 0.1.0))
(parsing-utils
(>= 0.0.7))
(>= 0.0.8))
(pp
(>= 1.2.0))
(pp-extended
Expand All @@ -60,7 +127,6 @@
(< v0.18)))
(ppx_expect
(and
:with-test
(>= v0.17)
(< v0.18)))
(ppx_hash
Expand Down
4 changes: 2 additions & 2 deletions src/auto_format.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct
~lexbuf:(Lexing.from_string pretty_printed_contents)
|> Parsing_result.or_error
in
Ref.set_temporarily Loc.equal_ignores_positions true ~f:(fun () ->
Ref.set_temporarily Loc.equal_ignores_locs true ~f:(fun () ->
T.equal program program_2)
in
let ts_are_equal =
Expand Down Expand Up @@ -302,7 +302,7 @@ into this issue.
debug_comments
~f:(fun () -> Parsing_utils.parse_exn (module T_syntax) ~path)
in
Ref.set_temporarily Loc.include_sexp_of_positions with_positions ~f:(fun () ->
Ref.set_temporarily Loc.include_sexp_of_locs with_positions ~f:(fun () ->
Eio_writer.with_flow (Eio.Stdenv.stdout env) (fun stdout ->
Eio_writer.write_sexp stdout [%sexp (program : T.t)])))
;;
Expand Down
3 changes: 3 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
-open
Base
-open
Loc0
-open
Fpath_base
-open
Commandlang)
Expand All @@ -21,6 +23,7 @@
eio_main
fpath
fpath-base
loc0
parsing-utils
pp
pp-extended)
Expand Down
8 changes: 6 additions & 2 deletions test/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(library
(name auto_format_test)
(public_name auto-format-tests.auto_format_test)
(inline_tests)
(flags
:standard
Expand All @@ -10,8 +11,11 @@
-open
Base
-open
Expect_test_helpers)
(libraries auto_format base expect-test-helpers)
Expect_test_helpers_base)
(libraries
auto_format
base
expect_test_helpers_core.expect_test_helpers_base)
(lint
(pps ppx_js_style -check-doc-comments))
(preprocess
Expand Down

0 comments on commit a24d458

Please sign in to comment.