Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the tests with OCaml 5.2 #14

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Conversation

kit-ty-kate
Copy link
Contributor

Otherwise the tests fail with:

#=== ERROR while compiling pecu.0.6 ===========================================#
# context              2.2.0~beta2~dev | linux/x86_64 | ocaml-variants.5.2.0+trunk | file:///home/opam/opam-repository
# path                 ~/.opam/5.2/.opam-switch/build/pecu.0.6
# command              ~/.opam/5.2/bin/dune runtest -p pecu -j 1
# exit-code            1
# env-file             ~/.opam/log/pecu-40-503db8.env
# output-file          ~/.opam/log/pecu-40-503db8.out
### output ###
# File "test/dune", line 5, characters 0-129:
# 5 | (alias
# 6 |  (name runtest)
# 7 |  (package pecu)
# 8 |  (deps (:test test.exe) (glob_files "contents/*"))
# 9 |  (action (run %{test} --color=always)))
# (cd _build/default/test && ./test.exe --color=always)
# Testing `pecu'.
# This run has ID `QBBAEDI8'.
# 
#   [OK]          input fuzz          0   contents/id:000000,src:000000,op:havo...
#   [OK]          input fuzz          1   contents/id:000000,src:000050,op:havo...
#   [OK]          input fuzz          2   contents/id:000001,src:000023,op:havo...
#   [OK]          input fuzz          3   contents/id:000001,src:000026+000032,...
#   [OK]          input fuzz          4   contents/id:000002,src:000023,op:havo...
#   [OK]          input fuzz          5   contents/id:000002,src:000063,op:int1...
#   [OK]          input fuzz          6   contents/id:000003,src:000024+000025,...
#   [OK]          input fuzz          7   contents/id:000003,src:000055,op:havo...
#   [OK]          input fuzz          8   contents/id:000004,src:000037+000000,...
# > [FAIL]        simple              0   simple example.
#   [OK]          simple              1   split at cr.
#   [OK]          rfc2047             0   rfc2047:0.
#   [OK]          rfc2047             1   rfc2047:1.
#   [OK]          rfc2047             2   rfc2047:2.
#   [OK]          rfc2047             3   rfc2047:3.
#   [OK]          rfc2047             4   rfc2047:4.
#   [OK]          rfc2047             5   rfc2047:5.
#   [OK]          rfc2047             6   rfc2047:6.
# 
# ┌──────────────────────────────────────────────────────────────────────────────┐
# │ [FAIL]        simple              0   simple example.                        │
# └──────────────────────────────────────────────────────────────────────────────┘
# ASSERT =
#  
# FAIL =
#  
# Raised at Alcotest_engine__Test.check_err in file "src/alcotest-engine/test.ml", line 157, characters 20-48
# Called from Test.simple.(fun) in file "test/test.ml", line 189, characters 15-49
# Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 181, characters 17-23
# Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35
# 
# Logs saved to `~/.opam/5.2/.opam-switch/build/pecu.0.6/_build/default/test/_build/_tests/pecu/simple.000.output'.
#  ──────────────────────────────────────────────────────────────────────────────
# 
# Full test results in `~/.opam/5.2/.opam-switch/build/pecu.0.6/_build/default/test/_build/_tests/pecu'.
# 1 failure! in 0.002s. 18 tests run.

The reason behind this required change is that ocaml/ocaml#12514 changed the way OCaml source files are parsed and {| ... |} strings containing \r+\n are not parsed the same now. To that end making the \r explicit is a reasonable change I feel.

@dinosaure
Copy link
Member

Thanks!

@dinosaure dinosaure merged commit 59eea78 into mirage:master Apr 4, 2024
1 check passed
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Apr 4, 2024
CHANGES:

* Upgrade the distribution with `fmt.0.8.7` (@dinosaure, mirage/pecu#12)
* Upgrade tests to be compatible with OCaml 5.2 (@kit-ty-kate, mirage/pecu#14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants