summaryrefslogtreecommitdiff
path: root/test/lisp/net/ntlm-tests.el
diff options
context:
space:
mode:
authorThomas Fitzsimmons <fitzsim@fitzsim.org>2021-02-19 17:07:52 -0500
committerThomas Fitzsimmons <fitzsim@fitzsim.org>2021-02-19 17:11:42 -0500
commitade9c22c0497f50e492a8fe8c0356c0c28e313b3 (patch)
tree4c281e5c04c6203e2aa8ffc54f591f67c1811cca /test/lisp/net/ntlm-tests.el
parent283f98353fe3549ac8f66a3ab8fba85d93c81a88 (diff)
downloademacs-ade9c22c0497f50e492a8fe8c0356c0c28e313b3.tar.gz
emacs-ade9c22c0497f50e492a8fe8c0356c0c28e313b3.tar.bz2
emacs-ade9c22c0497f50e492a8fe8c0356c0c28e313b3.zip
ntlm-tests: Skip tests if dependencies are too old
* test/lisp/net/ntlm-tests.el (ntlm-tests--dependencies-present): Add version and functionality checks. Co-authored-by: Michael Albinus <michael.albinus@gmx.de>
Diffstat (limited to 'test/lisp/net/ntlm-tests.el')
-rw-r--r--test/lisp/net/ntlm-tests.el19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/lisp/net/ntlm-tests.el b/test/lisp/net/ntlm-tests.el
index 0ed430afe68..c31ab83226c 100644
--- a/test/lisp/net/ntlm-tests.el
+++ b/test/lisp/net/ntlm-tests.el
@@ -382,8 +382,25 @@ ARGUMENTS are passed to it."
(concat "HTTP/1.1 200 OK\n\nAuthenticated." (unibyte-string 13) "\n")
"Expected result of successful NTLM authentication.")
+(require 'find-func)
+(defun ntlm-tests--ensure-ws-parse-ntlm-support ()
+ "Ensure NTLM special-case in `ws-parse'."
+ (let* ((hit (find-function-search-for-symbol
+ 'ws-parse nil (locate-file "web-server.el" load-path)))
+ (buffer (car hit))
+ (position (cdr hit)))
+ (with-current-buffer buffer
+ (goto-char position)
+ (search-forward-regexp
+ ":NTLM" (save-excursion (forward-sexp) (point)) t))))
+
+(require 'lisp-mnt)
(defvar ntlm-tests--dependencies-present
- (and (featurep 'url-http-ntlm) (featurep 'web-server))
+ (and (featurep 'url-http-ntlm)
+ (version<= "2.0.4"
+ (lm-version (locate-file "url-http-ntlm.el" load-path)))
+ (featurep 'web-server)
+ (ntlm-tests--ensure-ws-parse-ntlm-support))
"Non-nil if GNU ELPA test dependencies were loaded.")
(when (not ntlm-tests--dependencies-present)