linol/ocaml-lsp-server/test/ocaml_lsp_tests.ml
Simon Cruanes 7fbc187548 Squashed 'thirdparty/lsp/' content from commit aae69863
git-subtree-dir: thirdparty/lsp
git-subtree-split: aae6986391a8519de3da6a7a341f2bd3376e0d2f
2025-04-10 15:44:25 -04:00

20 lines
636 B
OCaml

let%expect_test "eat_message tests" =
let test e1 e2 expected =
let result = Ocaml_lsp_server.Diagnostics.equal_message e1 e2 in
if result = expected then print_endline "[PASS]" else print_endline "[FAIL]"
in
test "foo bar" "foo bar" true;
[%expect {| [PASS] |}];
test " foobar" "foobar" true;
[%expect {| [PASS] |}];
test "foobar" "foobar " true;
[%expect {| [PASS] |}];
test "foobar" "foobar\t" true;
[%expect {| [PASS] |}];
test "foobar" "foobar\n" true;
[%expect {| [PASS] |}];
test "foobar" "foo bar" false;
[%expect {| [PASS] |}];
test "foo bar" "foo Bar" false;
[%expect {| [PASS] |}]
;;