From dc61049ff16d2f3670fbed8fe470537ccf55a78d Mon Sep 17 00:00:00 2001 From: Matus Goljer Date: Wed, 1 Mar 2023 15:17:05 +0100 Subject: [PATCH] test(font): add tests for commented variable assignment Fixes #52 --- test/test-highlighting.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test-highlighting.el b/test/test-highlighting.el index 91c0ab0..f157598 100644 --- a/test/test-highlighting.el +++ b/test/test-highlighting.el @@ -271,6 +271,24 @@ bar = \"${foo}\" (forward-cursor-on "foo") (should (face-at-cursor-p 'font-lock-comment-face)))) +(ert-deftest font-lock--no-variable-assignment-in-comment--single-line () + (with-terraform-temp-buffer + "# foo = \"bar\"" + + (forward-cursor-on "foo") + (should (face-at-cursor-p 'font-lock-comment-face)))) + +(ert-deftest font-lock--no-variable-assignment-in-comment--backend-s3 () + (with-terraform-temp-buffer + "# backend \"s3\" { +# bucket = \"somestate\" +# key = \"tfstates/terraform.tfstate\" +# region = \"us-east-1\" +# } +" + (forward-cursor-on "bucket") + (should (face-at-cursor-p 'font-lock-comment-face)))) + (ert-deftest font-lock--map-statement () "Syntax highlight of map" (with-terraform-temp-buffer