Skip to content

Commit 66e062a

Browse files
committed
Add test for #439
GitHub-Issue: #439
1 parent e71fd6a commit 66e062a

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

php-mode-test.el

+4
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,10 @@ style from Drupal."
914914
(set-auto-mode)
915915
(should (not (eq 'php-mode major-mode))))))
916916

917+
(ert-deftest php-mode-test-issue-439 ()
918+
"Various heredoc/nowdoc formats are highlighted appropriately."
919+
(with-php-mode-test ("issue-439.php" :faces t)))
920+
917921
(ert-deftest php-mode-test-type-hints ()
918922
"Test highlighting of type hints and return types."
919923
(with-php-mode-test ("type-hints.php" :faces t)))

tests/issue-439.php

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/**
4+
* GitHub Issue: https://github.com/ejmr/php-mode/issues/439
5+
*/
6+
7+
$a = <<<ABC
8+
Let'go Justin
9+
ABC;
10+
11+
$b = <<<A_B_C
12+
Let'go Justin
13+
A_B_C;
14+
15+
$c = <<<'A_B_C'
16+
Let'go Justin
17+
A_B_C;
18+
19+
$d = <<<"A_B_C"
20+
Let'go Justin
21+
A_B_C;
22+
23+
$e = <<<いろは
24+
Let'go Justin
25+
いろは;
26+
27+
$f = <<<'いろは'
28+
Let'go Justin
29+
いろは;
30+
31+
$g = <<<"いろは"
32+
Let'go Justin
33+
いろは;

tests/issue-439.php.faces

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
;; -*- mode: emacs-lisp -*-
2+
(("<?php" . font-lock-preprocessor-face)
3+
("\n\n")
4+
("/**\n * GitHub Issue: " . font-lock-doc-face)
5+
("https://github.com/ejmr/php-mode/issues/439" link font-lock-doc-face)
6+
("\n */" . font-lock-doc-face)
7+
("\n\n")
8+
("$" . php-variable-sigil)
9+
("a" . php-variable-name)
10+
(" = ")
11+
("<<<ABC\nLet'go Justin\nABC" . php-string)
12+
(";\n\n")
13+
("$" . php-variable-sigil)
14+
("b" . php-variable-name)
15+
(" = ")
16+
("<<<A_B_C\nLet'go Justin\nA_B_C" . php-string)
17+
(";\n\n")
18+
("$" . php-variable-sigil)
19+
("c" . php-variable-name)
20+
(" = ")
21+
("<<<'A_B_C'\nLet'go Justin\nA_B_C" . php-string)
22+
(";\n\n")
23+
("$" . php-variable-sigil)
24+
("d" . php-variable-name)
25+
(" = ")
26+
("<<<\"A_B_C\"\nLet'go Justin\nA_B_C" . php-string)
27+
(";\n\n")
28+
("$" . php-variable-sigil)
29+
("e" . php-variable-name)
30+
(" = ")
31+
("<<<いろは\nLet'go Justin\nいろは" . php-string)
32+
(";\n\n")
33+
("$" . php-variable-sigil)
34+
("f" . php-variable-name)
35+
(" = ")
36+
("<<<'いろは'\nLet'go Justin\nいろは" . php-string)
37+
(";\n\n")
38+
("$" . php-variable-sigil)
39+
("g" . php-variable-name)
40+
(" = ")
41+
("<<<\"いろは\"\nLet'go Justin\nいろは" . php-string)
42+
(";\n"))

0 commit comments

Comments
 (0)