summaryrefslogtreecommitdiff
path: root/test/src/syntax-tests.el
Commit message (Collapse)AuthorAgeFilesLines
* Make parse-partial-sexp signal an error if TO is smaller than FROMLars Ingebrigtsen2021-08-211-0/+6
| | | | | * src/syntax.c (Fparse_partial_sexp): Signal an error if TO is smaller than FROM (bug#49944).
* Add a new function syntax-class-to-charLars Ingebrigtsen2021-06-151-0/+11
| | | | | * doc/lispref/syntax.texi (Syntax Table Internals): Document it. * src/syntax.c (Fsyntax_class_to_char): New function (bug#37452).
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Enhance syntax-tests.el to test nestable comments (Lisp style)Alan Mackenzie2020-11-171-3/+63
| | | | | | | | | | | | | | Also add some tests for braces and parse-partial-sexp amongst Lisp style comments. * test/src/syntax-tests.el (\;-in, \;-out): Add syntax for { and }. (top-level): Add new tests for Lisp style comments. (\#|-in, \#|-out): New functions. (top-level): Add new tests for nested Lisp style comments, and mixtures of nested comments with "ordinary" comments. * test/src/syntax-resources/syntax-comments.txt (top-level): Add new test fragments for #|...|#, etc.
* Move some test data to follow our conventionsStefan Kangas2020-10-231-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/data/emacs-module/mod-test.c: Move from here... * test/src/emacs-module-resources/mod-test.c: ...to here. * test/src/emacs-module-tests.el (ert-x): Require. (mod-test-file, module/describe-function-1): * test/Makefile.in (test_module_dir): Adjust for move. * test/data/files-bug18141.el.gz: Move from here... * test/lisp/files-resources/files-bug18141.el.gz: ... to here. * test/lisp/files-tests.el (ert-x): Require. (files-test-bug-18141-file): Use ert-resource-file. * test/data/mailcap/mime.types: Move from here... * test/lisp/net/mailcap-resources/mime.types: ...to here. * test/lisp/net/mailcap-tests.el (ert-x): Require. (mailcap-tests-path): Use ert-resource-file. * test/data/somelib.el: * test/data/somelib2.el: Move from here... * test/src/lread-resources/somelib.el: * test/src/lread-resources/somelib2.el: ...to here. * test/src/lread-tests.el (ert, ert-x): Require. (lread-test-bug26837): Use ert-resource-directory. * test/data/syntax-comments.txt: Move from here.... * test/src/syntax-resources/syntax-comments.txt: ...to here. * test/src/syntax-tests.el (ert-x): Require. (syntax-comments, syntax-br-comments, syntax-pps-comments): Use ert-resource-file. * test/data/xref/file1.txt: * test/data/xref/file2.txt: Move from here... * test/lisp/progmodes/xref-resources/file1.txt: * test/lisp/progmodes/xref-resources/file2.txt: ...to here. * test/lisp/progmodes/xref-tests.el (ert, ert-x): Require. (xref-tests-data-dir): Use ert-resource-directory.
* Enhance syntax-tests.el to test comments in parse-partial-sexpAlan Mackenzie2020-10-021-4/+88
| | | | | | | | | | | | | This now tests the interface between parse-partial-sexp and the low level comment function in syntax.c * test/src/syntax-tests.el (syntax-comments-midpoint): New function. (syntax-pps-comments): New macro. (top level): Two new syntax-br-comments tests and five new syntax-pps-comments tests. * test/data/syntax-comments.txt (top level): Amend some test fragments and add some more.
* Enhance syntax-tests.el to test comments in scan-listsAlan Mackenzie2020-10-021-5/+80
| | | | | | | | | | This now tests the interface between scan_lists and the comment functions. * test/src/syntax-tests.el (syntax-br-comments): New macro. ({-in, ;-in, /*-in): Set parse-sexp-ignore-comments to t. (top level): Add 15 tests for comments inside brace lists. * test/data/syntax-comments.txt (top level): Amend some test fragments.
* Enhance syntax-tests.el to test some comment character handling.Alan Mackenzie2020-10-011-0/+190
| | | | | | | * test/src/syntax-tests: Add a new section testing some aspects of comment handling in syntax.c. This needs further enhancement. It uses .... * test/data/syntax-comments.txt: A new test file.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Fix comment detection on open parensNoam Postavsky2017-01-231-0/+85
Characters having both open paren syntax and comment start syntax were being detected as open parens even when they should have been part a comment starter (Bug#24870). * src/syntax.c (in_2char_comment_start): New function, extracted from `scan_sexps_forward'. (scan_sexps_forward): Add check for a 2-char comment starter before the loop. Inside the loop, do that check after incrementing the 'from' character index. Move the single char comment syntax cases into the switch instead of special casing them before. * test/src/syntax-tests.el (parse-partial-sexp-paren-comments): (parse-partial-sexp-continue-over-comment-marker): New tests.