(props-out (object-intervals out)))
(should (equal props-out props-in))))))))
-(ert-deftest subr-tests-internal--c-header-file-path ()
- (should (seq-every-p #'stringp (internal--c-header-file-path)))
- (should (locate-file "stdio.h" (internal--c-header-file-path)))
- (or (memq system-type '(windows-nt ms-dos))
- (should (member "/usr/include" (internal--c-header-file-path))))
- (should (equal (internal--c-header-file-path)
- (delete-dups (internal--c-header-file-path))))
- ;; Return a meaningful result even if calling some compiler fails.
- (cl-letf (((symbol-function 'call-process)
- (lambda (_program &optional _infile _destination _display &rest _args) 1)))
- (should (seq-every-p #'stringp (internal--c-header-file-path)))
- (should (member (expand-file-name "/usr/include")
- (internal--c-header-file-path)))
- (should (equal (internal--c-header-file-path)
- (delete-dups (internal--c-header-file-path))))))
-
-(ert-deftest subr-tests-internal--c-header-file-path/gcc-mocked ()
- ;; Handle empty values of "gcc -print-multiarch".
- (cl-letf (((symbol-function 'call-process)
- (lambda (_program &optional _infile _destination _display &rest args)
- (when (equal (car args) "-print-multiarch")
- (insert "\n") 0))))
- (should (member (expand-file-name "/usr/include")
- (internal--c-header-file-path))))
- ;; Handle single values of "gcc -print-multiarch".
- (cl-letf ((system-type 'foo)
- ((symbol-function 'call-process)
- (lambda (_program &optional _infile _destination _display &rest args)
- (when (equal (car args) "-print-multiarch")
- (insert "x86_64-linux-gnu\n") 0))))
- (should (member (expand-file-name "/usr/include/x86_64-linux-gnu")
- (internal--c-header-file-path)))))
-
-(ert-deftest subr-tests-internal--c-header-file-path/clang-mocked ()
- ;; Handle clang 15.0.0 output on macOS 15.2.
- (cl-letf (((symbol-function 'internal--gcc-is-clang-p) (lambda () t))
- ((symbol-function 'call-process)
- (lambda (_program &optional _infile _destination _display &rest _args)
- (insert "\
-Apple clang version 15.0.0 (clang-1500.3.9.4)
-Target: arm64-apple-darwin24.2.0
-Thread model: posix
-InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
- \"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang\"
-[[[...Emacs test omits some verbose junk from the output here...]]]
-clang -cc1 version 15.0.0 (clang-1500.3.9.4) default target arm64-apple-darwin24.2.0
-ignoring nonexistent directory \"/usr/local/include\"
-#include \"...\" search starts here:
-#include <...> search starts here:
- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include
- /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
- /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
-End of search list.
-# 1 \"<stdin>\"
-# 1 \"<built-in>\" 1
-# 1 \"<built-in>\" 3
-# 418 \"<built-in>\" 3
-# 1 \"<command line>\" 1
-# 1 \"<built-in>\" 2
-# 1 \"<stdin>\" 2")
- 0)))
- (should (member (expand-file-name "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include")
- (internal--c-header-file-path)))))
+(ert-deftest hash-table-contains-p ()
+ (let ((h (make-hash-table)))
+ (should-not (hash-table-contains-p 'problems h))
+ (should-not (hash-table-contains-p 'cookie h))
+ (should-not (hash-table-contains-p 'milk h))
+ (puthash 'problems 99 h)
+ (puthash 'cookie nil h)
+ (puthash 'milk 'missing h)
+ (should (hash-table-contains-p 'problems h))
+ (should (hash-table-contains-p 'cookie h))
+ (should (hash-table-contains-p 'milk h))))
(provide 'subr-tests)
;;; subr-tests.el ends here