You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Alcotest.check with Alcotest.string as its testable and there is a failure, alcotest prints the expected and received outputs incorrectly if they are Unicode characters.
Clearly the expected and received values are different, and here is the result:
File "test/dune", line 2, characters 7-22:
2 | (name test_my_project)
^^^^^^^^^^^^^^^
Testing `Test'.
This run has ID `AT8IJ0GN'.
> [FAIL] Test 0 test_case.
┌──────────────────────────────────────────────────────────────────────────────┐
│ [FAIL] Test 0 test_case. │
└──────────────────────────────────────────────────────────────────────────────┘
ASSERT Dummy test
FAIL Dummy test
Expected: `"\226\136\128"'
Received: `"\226\136\131"'
Raised at Alcotest_engine__Test.check in file "src/alcotest-engine/test.ml", line 200, characters 4-261
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 `~/Documents/alcotestbug/_build/default/test/_build/_tests/Test/Test.000.output'.
──────────────────────────────────────────────────────────────────────────────
Full test results in `~/Documents/alcotestbug/_build/default/test/_build/_tests/Test'.
1 failure! in 0.000s. 1 test run.
I tested this when using custom pretty printers and there was no such error.
openAlcotesttypet = {name: string}
letpp_personfmtperson=Fmt.pf fmt "{ foo = %s }" person.name
let person_testable = testable pp_person (=)
(* Test the find_person function with a pattern match *)lettest_find_person()=
check person_testable "Dummy test" {name ="∀"} {name ="∃"}
let()=
run "Test" [
"Test", [
test_case "test_case"`Quick test_find_person;
];
]
File "test/dune", line 2, characters 7-22:
2 | (name test_my_project)
^^^^^^^^^^^^^^^
Testing `Test'.
This run has ID `MJPDELRM'.
> [FAIL] Test 0 test_case.
┌──────────────────────────────────────────────────────────────────────────────┐
│ [FAIL] Test 0 test_case. │
└──────────────────────────────────────────────────────────────────────────────┘
ASSERT Dummy test
FAIL Dummy test
Expected: `{ foo = ∀ }'
Received: `{ foo = ∃ }'
Raised at Alcotest_engine__Test.check in file "src/alcotest-engine/test.ml", line 200, characters 4-261
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 `~/Documents/alcotestbug/_build/default/test/_build/_tests/Test/Test.000.output'.
──────────────────────────────────────────────────────────────────────────────
Full test results in `~/Documents/alcotestbug/_build/default/test/_build/_tests/Test'.
1 failure! in 0.000s. 1 test run.
The text was updated successfully, but these errors were encountered:
When using
Alcotest.check
withAlcotest.string
as its testable and there is a failure, alcotest prints the expected and received outputs incorrectly if they are Unicode characters.Here is a minimum example:
Clearly the expected and received values are different, and here is the result:
I tested this when using custom pretty printers and there was no such error.
The text was updated successfully, but these errors were encountered: