emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ade9c22 1/2: ntlm-tests: Skip tests if dependencies are too old


From: Thomas Fitzsimmons
Subject: master ade9c22 1/2: ntlm-tests: Skip tests if dependencies are too old
Date: Fri, 19 Feb 2021 17:14:35 -0500 (EST)

branch: master
commit ade9c22c0497f50e492a8fe8c0356c0c28e313b3
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>

    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>
---
 test/lisp/net/ntlm-tests.el | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/test/lisp/net/ntlm-tests.el b/test/lisp/net/ntlm-tests.el
index 0ed430a..c31ab83 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]