From 6c89957c5d606af75f7917f7a9bb1488a77b99f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulysse=20G=C3=A9rard?= Date: Wed, 19 Jun 2024 17:34:03 +0200 Subject: [PATCH] test: additional cases --- tests/test-dirs/signature-help/sh-mix.t | 49 +++++++++++++++++++ .../{ => signature-help}/signature-help.t | 0 2 files changed, 49 insertions(+) create mode 100644 tests/test-dirs/signature-help/sh-mix.t rename tests/test-dirs/{ => signature-help}/signature-help.t (100%) diff --git a/tests/test-dirs/signature-help/sh-mix.t b/tests/test-dirs/signature-help/sh-mix.t new file mode 100644 index 000000000..28e023b76 --- /dev/null +++ b/tests/test-dirs/signature-help/sh-mix.t @@ -0,0 +1,49 @@ + $ cat >test.ml <<'EOF' + > let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z) + > let _ = f + > EOF + +First is the first parameter: + $ $MERLIN single signature-help -position 2:11 -filename test jq '.value.activeParameter' + 0 + + $ cat >test.ml <<'EOF' + > let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z) + > let _ = f 0 + > EOF + +FIXME: After we expect the next non-labelled parameter to be active: + $ $MERLIN single signature-help -position 2:12 -filename test jq '.value.activeParameter' + 0 + + $ cat >test.ml <<'EOF' + > let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z) + > let _ = f 0 3 + > EOF + +It does happen when the expression is being writter: + $ $MERLIN single signature-help -position 2:12 -filename test jq '.value.activeParameter' + 2 + + $ cat >test.ml <<'EOF' + > let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z) + > let _ = f 0 ~ + > EOF + +And when a tilde is used the first labelled arg is higlighted: + $ $MERLIN single signature-help -position 2:13 -filename test jq '.value.activeParameter' + 1 + + $ cat >test.ml <<'EOF' + > let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z) + > let _ = f 0 ~lbl_b + > EOF + +Or the second one is the name corresponds: + $ $MERLIN single signature-help -position 2:18 -filename test jq '.value.activeParameter' + 3 diff --git a/tests/test-dirs/signature-help.t b/tests/test-dirs/signature-help/signature-help.t similarity index 100% rename from tests/test-dirs/signature-help.t rename to tests/test-dirs/signature-help/signature-help.t