Skip to content

Commit a1d9533

Browse files
committed
Refactoring
- Fix indentation - Use '=' instead of eq for numeric comparison
1 parent eef97db commit a1d9533

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

php-mode-test.el

+21-22
Original file line numberDiff line numberDiff line change
@@ -440,16 +440,16 @@ style from Drupal."
440440
(ert-deftest php-mode-test-language-constructs()
441441
"Test highlighting of language constructs and reserved keywords"
442442
(with-php-mode-test ("language-constructs.php")
443-
(while (search-forward "ClassName" nil t)
444-
(backward-char)
445-
(should (eq 'font-lock-type-face
446-
(get-text-property (point) 'face)))))
443+
(while (search-forward "ClassName" nil t)
444+
(backward-char)
445+
(should (eq 'font-lock-type-face
446+
(get-text-property (point) 'face)))))
447447
(with-php-mode-test ("language-constructs.php")
448-
(search-forward "Start:")
449-
(while (not (= (line-number-at-pos) (count-lines (point-min) (point-max))))
450-
(forward-line 1)
451-
(should (eq 'font-lock-keyword-face
452-
(get-text-property (point) 'face))))))
448+
(search-forward "Start:")
449+
(while (not (= (line-number-at-pos) (count-lines (point-min) (point-max))))
450+
(forward-line 1)
451+
(should (eq 'font-lock-keyword-face
452+
(get-text-property (point) 'face))))))
453453

454454
(ert-deftest php-mode-test-issue-178 ()
455455
"Highligth as keyword and following symbol"
@@ -478,17 +478,16 @@ style from Drupal."
478478
(ert-deftest php-mode-test-issue-197 ()
479479
"Test highlighting of member and function names (should not have type face)"
480480
(with-php-mode-test ("issue-197.php")
481-
(while
482-
(search-forward "$test->" nil t)
483-
(should-not (eq 'font-lock-type-face
484-
(get-text-property (point) 'face))))))
481+
(while (search-forward "$test->" nil t)
482+
(should-not (eq 'font-lock-type-face
483+
(get-text-property (point) 'face))))))
485484

486485
(ert-deftest php-mode-test-issue-200 ()
487486
"Test highlighting and elimination of extraneous whitespace in PSR-2 mode"
488487
(with-php-mode-test ("issue-200.php")
489-
(php-mode-custom-coding-style-set 'php-mode-coding-style 'psr2)
490-
(should show-trailing-whitespace)
491-
(should (and (listp before-save-hook) (member 'delete-trailing-whitespace before-save-hook)))))
488+
(php-mode-custom-coding-style-set 'php-mode-coding-style 'psr2)
489+
(should show-trailing-whitespace)
490+
(should (and (listp before-save-hook) (member 'delete-trailing-whitespace before-save-hook)))))
492491

493492
(ert-deftest php-mode-test-issue-201 ()
494493
"Test highlighting of special variables"
@@ -529,11 +528,11 @@ style from Drupal."
529528
(ert-deftest php-mode-test-issue-184()
530529
"Test indent-line for statements and heredoc end at beginning of lines"
531530
(with-php-mode-test ("issue-184.php")
532-
(search-forward "html;")
533-
(php-cautious-indent-line)
534-
(should (eq (current-indentation) 0))
535-
(search-forward "return;")
536-
(php-cautious-indent-line)
537-
(should (eq (current-indentation) c-basic-offset))))
531+
(search-forward "html;")
532+
(php-cautious-indent-line)
533+
(should (= (current-indentation) 0))
534+
(search-forward "return;")
535+
(php-cautious-indent-line)
536+
(should (= (current-indentation) c-basic-offset))))
538537

539538
;;; php-mode-test.el ends here

0 commit comments

Comments
 (0)