(defun comp-mvar-symbol-p (mvar)
"Return t if MVAR is certainly a symbol."
- (or (equal (comp-mvar-typeset mvar) '(symbol))
- (cl-every #'symbolp (comp-mvar-valset mvar))))
+ (and (null (comp-mvar-range mvar))
+ (or (and (null (comp-mvar-valset mvar))
+ (equal (comp-mvar-typeset mvar) '(symbol)))
+ (and (or (null (comp-mvar-typeset mvar))
+ (equal (comp-mvar-typeset mvar) '(symbol)))
+ (cl-every #'symbolp (comp-mvar-valset mvar))))))
(defsubst comp-mvar-cons-p (mvar)
"Return t if MVAR is certainly a cons."
- (equal (comp-mvar-typeset mvar) '(cons)))
+ (and (null (comp-mvar-valset mvar))
+ (null (comp-mvar-range mvar))
+ (equal (comp-mvar-typeset mvar) '(cons))))
(defun comp-mvar-type-hint-match-p (mvar type-hint)
"Match MVAR against TYPE-HINT.
it
nil)))
+(defun comp-test-44968-f (start end)
+ (let ((dirlist)
+ (dir (expand-file-name start))
+ (end (expand-file-name end)))
+ (while (not (or (equal dir (car dirlist))
+ (file-equal-p dir end)))
+ (push dir dirlist)
+ (setq dir (directory-file-name (file-name-directory dir))))
+ (nreverse dirlist)))
+
\f
;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests ;;
(should (string= (comp-test-42360-f "Nel mezzo del " 18 0 32 "yyy" nil)
"Nel mezzo del yyy")))
+(comp-deftest bug-44968 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-11/msg02357.html>"
+ (comp-test-44968-f "/tmp/test/foo" "/tmp"))
+
(defvar comp-test-primitive-advice)
(comp-deftest primitive-advice ()
"Test effectiveness of primitive advicing."