From 4bc6990adaba2ec409e0611e4eb7bb8827bcf246 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Mon, 31 Mar 2025 12:09:53 -0400 Subject: [PATCH] Add test showing issue --- tests/test-dirs/locate/issue1915.t | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/test-dirs/locate/issue1915.t diff --git a/tests/test-dirs/locate/issue1915.t b/tests/test-dirs/locate/issue1915.t new file mode 100644 index 0000000000..f5481290fa --- /dev/null +++ b/tests/test-dirs/locate/issue1915.t @@ -0,0 +1,58 @@ +Testing the behavior of custom operators + + $ cat >main.ml < let ( := ) v a = Printf.printf "%s = %d;\n" v a + > let () = "foo" := 3 + > let () = ( := ) "foo" 3 + > EOF + + $ $MERLIN single locate -look-for ml -position 2:17 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not a valid identifier" + + $ $MERLIN single locate -look-for ml -position 3:12 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not a valid identifier" + +Testing custom indexing operators + + $ cat >main.ml < let (.%{;..}) a k = Printf.printf "%s.coeffRef(%d);\n" a k.(0) + > let (.%{ }) a k = Printf.printf "%s.coeffRef(%d);\n" a k + > let name = "baz" + > let () = name.%{2;4} + > let () = name.%{5} + > let () = ( .%{ } ) name 3 + > EOF + + $ $MERLIN single locate -look-for ml -position 4:15 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not in environment '%'" + + $ $MERLIN single locate -look-for ml -position 4:16 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not a valid identifier" + + $ $MERLIN single locate -look-for ml -position 5:15 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not in environment '%'" + + $ $MERLIN single locate -look-for ml -position 5:15 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not in environment '%'" + + $ $MERLIN single locate -look-for ml -position 5:16 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not a valid identifier" + + $ $MERLIN single locate -look-for ml -position 6:13 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not in environment '%'" + + $ $MERLIN single locate -look-for ml -position 6:14 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not a valid identifier" + + $ $MERLIN single locate -look-for ml -position 6:15 \ + > -filename ./main.ml < ./main.ml | jq '.value' + "Not a valid identifier"