diff options
| author | Po Lu | 2023-05-27 09:49:49 +0800 |
|---|---|---|
| committer | Po Lu | 2023-05-27 09:49:49 +0800 |
| commit | cdca0fddcc3352bcd01bec147c264be1b2a04e12 (patch) | |
| tree | 3b15e37936fecc34314883a41a355873c2b9133c /test | |
| parent | 0eb1f4e57125117006f109a5549082008fc9fbb1 (diff) | |
| parent | e77e986a9b7d735c0e39198c8b80a34a29005fc5 (diff) | |
| download | emacs-cdca0fddcc3352bcd01bec147c264be1b2a04e12.tar.gz emacs-cdca0fddcc3352bcd01bec147c264be1b2a04e12.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/package-tests.el | 11 | ||||
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 16 | ||||
| -rw-r--r-- | test/src/lread-tests.el | 16 | ||||
| -rw-r--r-- | test/src/sqlite-tests.el | 23 | ||||
| -rw-r--r-- | test/src/treesit-tests.el | 2 |
5 files changed, 55 insertions, 13 deletions
diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 0016fb586b7..113b4ec12a8 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el | |||
| @@ -219,9 +219,14 @@ Must called from within a `tar-mode' buffer." | |||
| 219 | 219 | ||
| 220 | (ert-deftest package-test-desc-from-buffer () | 220 | (ert-deftest package-test-desc-from-buffer () |
| 221 | "Parse an elisp buffer to get a `package-desc' object." | 221 | "Parse an elisp buffer to get a `package-desc' object." |
| 222 | (with-package-test (:basedir (ert-resource-directory) :file "simple-single-1.3.el") | 222 | (with-package-test (:basedir (ert-resource-directory) |
| 223 | (should (package-test--compatible-p | 223 | :file "simple-single-1.3.el") |
| 224 | (package-buffer-info) simple-single-desc 'kind))) | 224 | (let ((pi (package-buffer-info))) |
| 225 | (should (package-test--compatible-p pi simple-single-desc 'kind)) | ||
| 226 | ;; The terminating line is not mandatory any more. | ||
| 227 | (re-search-forward "^;;; .* ends here") | ||
| 228 | (delete-region (match-beginning 0) (point-max)) | ||
| 229 | (should (equal (package-buffer-info) pi)))) | ||
| 225 | (with-package-test (:basedir (ert-resource-directory) :file "simple-depend-1.0.el") | 230 | (with-package-test (:basedir (ert-resource-directory) :file "simple-depend-1.0.el") |
| 226 | (should (package-test--compatible-p | 231 | (should (package-test--compatible-p |
| 227 | (package-buffer-info) simple-depend-desc 'kind))) | 232 | (package-buffer-info) simple-depend-desc 'kind))) |
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 60b11d572cf..b916232c4be 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -729,6 +729,7 @@ u\"\\n\"" | |||
| 729 | (845 . font-lock-string-face) (886)))) | 729 | (845 . font-lock-string-face) (886)))) |
| 730 | 730 | ||
| 731 | (ert-deftest python-font-lock-escape-sequence-bytes-newline () | 731 | (ert-deftest python-font-lock-escape-sequence-bytes-newline () |
| 732 | :expected-result :failed | ||
| 732 | (python-tests-assert-faces | 733 | (python-tests-assert-faces |
| 733 | "b'\\n' | 734 | "b'\\n' |
| 734 | b\"\\n\"" | 735 | b\"\\n\"" |
| @@ -741,6 +742,7 @@ b\"\\n\"" | |||
| 741 | (11 . font-lock-doc-face)))) | 742 | (11 . font-lock-doc-face)))) |
| 742 | 743 | ||
| 743 | (ert-deftest python-font-lock-escape-sequence-hex-octal () | 744 | (ert-deftest python-font-lock-escape-sequence-hex-octal () |
| 745 | :expected-result :failed | ||
| 744 | (python-tests-assert-faces | 746 | (python-tests-assert-faces |
| 745 | "b'\\x12 \\777 \\1\\23' | 747 | "b'\\x12 \\777 \\1\\23' |
| 746 | '\\x12 \\777 \\1\\23'" | 748 | '\\x12 \\777 \\1\\23'" |
| @@ -761,6 +763,7 @@ b\"\\n\"" | |||
| 761 | (36 . font-lock-doc-face)))) | 763 | (36 . font-lock-doc-face)))) |
| 762 | 764 | ||
| 763 | (ert-deftest python-font-lock-escape-sequence-unicode () | 765 | (ert-deftest python-font-lock-escape-sequence-unicode () |
| 766 | :expected-result :failed | ||
| 764 | (python-tests-assert-faces | 767 | (python-tests-assert-faces |
| 765 | "b'\\u1234 \\U00010348 \\N{Plus-Minus Sign}' | 768 | "b'\\u1234 \\U00010348 \\N{Plus-Minus Sign}' |
| 766 | '\\u1234 \\U00010348 \\N{Plus-Minus Sign}'" | 769 | '\\u1234 \\U00010348 \\N{Plus-Minus Sign}'" |
| @@ -775,6 +778,7 @@ b\"\\n\"" | |||
| 775 | (80 . font-lock-doc-face)))) | 778 | (80 . font-lock-doc-face)))) |
| 776 | 779 | ||
| 777 | (ert-deftest python-font-lock-raw-escape-sequence () | 780 | (ert-deftest python-font-lock-raw-escape-sequence () |
| 781 | :expected-result :failed | ||
| 778 | (python-tests-assert-faces | 782 | (python-tests-assert-faces |
| 779 | "rb'\\x12 \123 \\n' | 783 | "rb'\\x12 \123 \\n' |
| 780 | r'\\x12 \123 \\n \\u1234 \\U00010348 \\N{Plus-Minus Sign}'" | 784 | r'\\x12 \123 \\n \\u1234 \\U00010348 \\N{Plus-Minus Sign}'" |
| @@ -6710,6 +6714,18 @@ class Class: | |||
| 6710 | (python-tests-look-at "'''Not a method docstring.'''") | 6714 | (python-tests-look-at "'''Not a method docstring.'''") |
| 6711 | (should (not (python-info-docstring-p))))) | 6715 | (should (not (python-info-docstring-p))))) |
| 6712 | 6716 | ||
| 6717 | (ert-deftest python-info-docstring-p-7 () | ||
| 6718 | "Test string in a dictionary." | ||
| 6719 | (python-tests-with-temp-buffer | ||
| 6720 | " | ||
| 6721 | {'Not a docstring': 1} | ||
| 6722 | 'Also not a docstring' | ||
| 6723 | " | ||
| 6724 | (python-tests-look-at "Not a docstring") | ||
| 6725 | (should-not (python-info-docstring-p)) | ||
| 6726 | (python-tests-look-at "Also not a docstring") | ||
| 6727 | (should-not (python-info-docstring-p)))) | ||
| 6728 | |||
| 6713 | (ert-deftest python-info-triple-quoted-string-p-1 () | 6729 | (ert-deftest python-info-triple-quoted-string-p-1 () |
| 6714 | "Test triple quoted string." | 6730 | "Test triple quoted string." |
| 6715 | (python-tests-with-temp-buffer | 6731 | (python-tests-with-temp-buffer |
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index fc00204ce7b..eae4893ee1b 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el | |||
| @@ -360,4 +360,20 @@ literals (Bug#20852)." | |||
| 360 | (should (byte-code-function-p f)) | 360 | (should (byte-code-function-p f)) |
| 361 | (should (equal (aref f 4) "My little\ndoc string\nhere")))))) | 361 | (should (equal (aref f 4) "My little\ndoc string\nhere")))))) |
| 362 | 362 | ||
| 363 | (ert-deftest lread-skip-to-eof () | ||
| 364 | ;; Check the special #@00 syntax that, for compatibility, reads as | ||
| 365 | ;; nil while absorbing the remainder of the input. | ||
| 366 | (with-temp-buffer | ||
| 367 | (insert "#@00 and the rest\n" | ||
| 368 | "should be ignored) entirely\n") | ||
| 369 | (goto-char (point-min)) | ||
| 370 | (should (equal (read (current-buffer)) nil)) | ||
| 371 | (should (eobp)) | ||
| 372 | ;; Add an unbalanced bracket to the beginning and try again; | ||
| 373 | ;; we should get an error. | ||
| 374 | (goto-char (point-min)) | ||
| 375 | (insert "( ") | ||
| 376 | (goto-char (point-min)) | ||
| 377 | (should-error (read (current-buffer)) :type 'end-of-file))) | ||
| 378 | |||
| 363 | ;;; lread-tests.el ends here | 379 | ;;; lread-tests.el ends here |
diff --git a/test/src/sqlite-tests.el b/test/src/sqlite-tests.el index 460651def78..f7144c15887 100644 --- a/test/src/sqlite-tests.el +++ b/test/src/sqlite-tests.el | |||
| @@ -197,10 +197,13 @@ | |||
| 197 | (sqlite-load-extension db "/usr/lib/sqlite3/")) | 197 | (sqlite-load-extension db "/usr/lib/sqlite3/")) |
| 198 | (should-error | 198 | (should-error |
| 199 | (sqlite-load-extension db "/usr/lib/sqlite3")) | 199 | (sqlite-load-extension db "/usr/lib/sqlite3")) |
| 200 | (should | 200 | (if (eq system-type 'windows-nt) |
| 201 | (memq | 201 | (should |
| 202 | (sqlite-load-extension db "/usr/lib/sqlite3/pcre.so") | 202 | (eq (sqlite-load-extension db "/usr/lib/sqlite3/pcre.dll") |
| 203 | '(nil t))) | 203 | (file-readable-p "/usr/lib/sqlite3/pcre.dll"))) |
| 204 | (should | ||
| 205 | (eq (sqlite-load-extension db "/usr/lib/sqlite3/pcre.so") | ||
| 206 | (file-readable-p "/usr/lib/sqlite3/pcre.so")))) | ||
| 204 | 207 | ||
| 205 | (should-error | 208 | (should-error |
| 206 | (sqlite-load-extension | 209 | (sqlite-load-extension |
| @@ -211,11 +214,13 @@ | |||
| 211 | (should-error | 214 | (should-error |
| 212 | (sqlite-load-extension | 215 | (sqlite-load-extension |
| 213 | db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable")) | 216 | db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable")) |
| 214 | (should | 217 | (if (eq system-type 'windows-nt) |
| 215 | (memq | 218 | (should |
| 216 | (sqlite-load-extension | 219 | (eq (sqlite-load-extension db "/usr/lib/sqlite3/csvtable.dll") |
| 217 | db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so") | 220 | (file-readable-p "/usr/lib/sqlite3/csvtable.dll"))) |
| 218 | '(nil t))))) | 221 | (should |
| 222 | (eq (sqlite-load-extension db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so") | ||
| 223 | (file-readable-p "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so")))))) | ||
| 219 | 224 | ||
| 220 | (ert-deftest sqlite-blob () | 225 | (ert-deftest sqlite-blob () |
| 221 | (skip-unless (sqlite-available-p)) | 226 | (skip-unless (sqlite-available-p)) |
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 4aa81a9ce0b..7a8e53924eb 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el | |||
| @@ -69,7 +69,7 @@ | |||
| 69 | (should | 69 | (should |
| 70 | (equal (treesit-node-string | 70 | (equal (treesit-node-string |
| 71 | (treesit-parser-root-node parser)) | 71 | (treesit-parser-root-node parser)) |
| 72 | "(ERROR)")) | 72 | "(document)")) |
| 73 | 73 | ||
| 74 | (insert "[1,2,3]") | 74 | (insert "[1,2,3]") |
| 75 | (should | 75 | (should |