From 76ac0c2f18357ed213723bf329280ad1e385ee5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulysse=20G=C3=A9rard?= Date: Mon, 10 Jun 2024 15:45:48 +0200 Subject: [PATCH] Add test showing issue with unstable uids --- .../server-tests/pwo-uid-stability.t | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 tests/test-dirs/server-tests/pwo-uid-stability.t diff --git a/tests/test-dirs/server-tests/pwo-uid-stability.t b/tests/test-dirs/server-tests/pwo-uid-stability.t new file mode 100644 index 000000000..5003d1844 --- /dev/null +++ b/tests/test-dirs/server-tests/pwo-uid-stability.t @@ -0,0 +1,186 @@ + $ $MERLIN server stop-server + + $ cat >lib.ml <<'EOF' + > let x = () + > + > let z = () + > EOF + + $ cat >main.ml <<'EOF' + > let () = Lib.z + > EOF + + $ $OCAMLC -c -bin-annot -bin-annot-occurrences lib.ml main.ml + $ ocaml-index aggregate lib.cmt main.cmt -o .ocaml-index + $ ocaml-index dump .ocaml-index + 2 uids: + {uid: Lib.0; locs: "x": File "lib.ml", line 1, characters 4-5 + uid: Lib.1; locs: + "z": File "lib.ml", line 3, characters 4-5; + "Lib.z": File "main.ml", line 1, characters 9-14 + }, 0 approx shapes: {}, and shapes for CUS . + +FIXME: duplicated occurrence + $ $MERLIN server occurrences -identifier-at 3:4 \ + > -scope project -index-file .ocaml-index \ + > -log-file log -log-section occurrences \ + > -filename lib.ml lib.ml <<'EOF' + > let x = () + > let y = () + > let z = () + > EOF + + $ $OCAMLC -c -bin-annot -bin-annot-occurrences lib.ml main.ml + $ ocaml-index aggregate lib.cmt main.cmt -o .ocaml-index + $ ocaml-index dump .ocaml-index + 3 uids: + {uid: Lib.0; locs: "x": File "lib.ml", line 1, characters 4-5 + uid: Lib.1; locs: "y": File "lib.ml", line 2, characters 4-5 + uid: Lib.2; locs: + "z": File "lib.ml", line 3, characters 4-5; + "Lib.z": File "main.ml", line 1, characters 9-14 + }, 0 approx shapes: {}, and shapes for CUS . + +FIXME: We are missing the occurrence in main.ml + $ $MERLIN server occurrences -identifier-at 3:4 \ + > -scope project -index-file .ocaml-index \ + > -log-file log -log-section occurrences \ + > -filename lib.ml lib.ml <<'EOF' + > let x = () + > + > let z = () + > EOF + + $ $OCAMLC -c -bin-annot -bin-annot-occurrences lib.ml main.ml + $ ocaml-index aggregate lib.cmt main.cmt -o .ocaml-index + $ ocaml-index dump .ocaml-index + 2 uids: + {uid: Lib.0; locs: "x": File "lib.ml", line 1, characters 4-5 + uid: Lib.1; locs: + "z": File "lib.ml", line 3, characters 4-5; + "Lib.z": File "main.ml", line 1, characters 9-14 + }, 0 approx shapes: {}, and shapes for CUS . + +FIXME: we are missing the occurrence in main.ml + $ $MERLIN server occurrences -identifier-at 3:4 \ + > -scope project -index-file .ocaml-index \ + > -log-file log -log-section occurrences \ + > -filename lib.ml