@@ -63,22 +63,24 @@ These are the ###php-mode-test### comments. Valid magics are
63
63
listed in `php-mode-test-valid-magics' ; no other directives will
64
64
be processed."
65
65
(cl-letf (((symbol-function 'indent )
66
- (lambda (offset ) (equal (current-indentation ) offset))))
66
+ (lambda (offset )
67
+ (let ((current-offset (current-indentation )))
68
+ (unless (eq current-offset offset)
69
+ (list :line (line-number-at-pos )
70
+ :expected offset
71
+ :actual current-offset))))))
67
72
(let (directives answers)
68
73
(save-excursion
69
74
(goto-char (point-min ))
70
- (while (re-search-forward php-mode-test-magic-regexp nil t )
71
- (setq directives (read (buffer-substring (match-beginning 1 )
72
- (match-end 1 ))))
73
- (setq answers
74
- (append (mapcar (lambda (curr )
75
- (let ((fn (car curr))
76
- (args (mapcar 'eval (cdr-safe curr))))
77
- (if (memq fn php-mode-test-valid-magics)
78
- (apply fn args))))
79
- directives)
80
- answers))))
81
- answers)))
75
+ (cl-loop while (re-search-forward php-mode-test-magic-regexp nil t )
76
+ for directives = (read (buffer-substring (match-beginning 1 ) (match-end 1 )))
77
+ for result = (mapcar (lambda (expr )
78
+ (let ((fn (car expr))
79
+ (args (mapcar 'eval (cdr-safe expr))))
80
+ (if (memq fn php-mode-test-valid-magics)
81
+ (apply fn args))))
82
+ directives)
83
+ append (cl-remove-if #'null result))))))
82
84
83
85
(defun php-mode-test--buffer-face-list (buffer )
84
86
" Return list of (STRING . FACE) from `BUFFER' ."
@@ -154,8 +156,9 @@ file name and check that the faces of the fonts in the buffer match."
154
156
,(if indent
155
157
'(let ((inhibit-message t )) (indent-region (point-min ) (point-max ))))
156
158
,(if magic
157
- '(should (cl-reduce (lambda (l r ) (and l r))
158
- (php-mode-test-process-magics))))
159
+ `(should (equal
160
+ (cons , file nil )
161
+ (cons , file (php-mode-test-process-magics)))))
159
162
,(if faces
160
163
`(should (equal
161
164
(cons , file
0 commit comments