aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/editfns-tests.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* More tests for edit functions, buffers, and markers.Eric S. Raymond13 days1-0/+95
|
* Added more buffer/marker/editing test coverage.Eric S. Raymond13 days1-0/+41
|
* More test coverage improvements.Eric S. Raymond13 days1-0/+27
| | | | | | | Bignum corner-case tests in data-tests.el. More buffer-primitive tests in editfns-test.el Some condition-case tesrs in eval-tests.el. And another marker-primitive test in marker-tests.el.
* More test coverage improvements for ERT.Eric S. Raymond13 days1-0/+61
| | | | In marker-tests.el, editfbs-tests.el, and data-tests.el.
* Crrections to tedt coverrage extensuion after bootstrap build.Eric S. Raymond13 days1-1/+2
| | | | Files: data-tests.el, editfns-tests.el.
* Tests for 7 editor primitives previously not covered.Eric S. Raymond13 days1-0/+83
| | | | | | | | | | - byte-to-position - byte-to-string - insert-byte - insert-buffer-substring - insert-before-markers-and-inherit - field-string-and-delete - constrain-to-field
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* December 2025 spelling fixesPaul Eggert2025-12-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the fixes are to continue to use American rather than British spelling. * doc/misc/modus-themes.org (my-modus-themes-engraved-faces): Fix misspelled ‘:foreground’s. * etc/themes/modus-themes.el (modus-themes-faces): Fix misspelled ‘modus-themes-bold’. * lisp/emacs-lisp/rx.el (rx--normalize-char-pattern): Rename from rx--normalise-char-pattern. (rx--optimize-or-args): Rename from rx--optimise-or-args. * lisp/frame.el (frame--special-parameters): Fix misspelled "right-divider-width". * lisp/net/tramp.el (tramp-fingerprint-prompt-regexp): Use American spelling “centered”, to match current libfprintf. * lisp/org/org-fold-core.el (org-fold-core--optimize-for-huge-buffers): Rename from org-fold-core--optimise-for-huge-buffers. (org-fold-core-update-optimization): Rename from org-fold-core-update-optimisation, leaving an alias behind. (org-fold-core-remove-optimization): Rename from org-fold-core-remove-optimisation, leaving an alias behind. * lisp/org/org.el (org-advertized-archive-subtree): This alias is now obsolete. * lisp/play/zone.el (zone-ignored-buffers): Fix misspelling of ‘zone--buffer-encrypted-p’. * lisp/progmodes/csharp-mode.el (csharp-ts-mode-faces): Fix misspelling of ‘csharp’ group. * lisp/vc/vc.el (vc-clonable-backends-custom-type): Rename from vc-cloneable-backends-custom-type, leaving an alias behind. * test/lisp/emacs-lisp/bytecomp-tests.el: (bytecomp-tests--warn-arity-non-compiled-callee): Rename from bytecomp-tests--warn-arity-noncompiled-callee. (bytecomp-test-defface-spec): Reword a deliberate misspelling of “default” that is so common I don’t want it to pollute the spelling dictionary. * test/lisp/emacs-lisp/package-vc-tests.el: (package-vc-tests-preserve-artifacts): Rename from package-vc-tests-preserve-artifacts. * test/lisp/eshell/em-prompt-tests.el: (em-prompt-test/forward-backward-paragraph-1): Reword a deliberate misspelling of “goodbye” that is so common I don’t want it to pollute the spelling dictionary.
* Add binary format specifications '%b' and '%B'Jacob S. Gordon2025-12-221-2/+81
| | | | | | | | | | | | | | | | These produce the binary representation of a number. '%#b' and '%#B' prefix with '0b' and '0B', respectively. (bug#79990) * etc/NEWS: Announce change. * doc/lispref/strings.texi (Formatting Strings): Describe new format specs and add to comment on reconstructing the value with 'read'. * src/editfns.c (format): Update doc string. (styled_format): Add support for '%b' and '%B'. To remain portable, avoid use of 'sprintf' by converting by hand. * test/src/editfns-tests.el (format-binary-zero, format-binary-floats) (format-binary-nonzero-integers): Add tests. (read-large-integer): Add binary test cases. Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>
* Improve handling of non-ASCII characters in 'transpose-regions'Jens Schmidt2025-12-201-0/+204
| | | | | | | | | | | * src/editfns.c (Ftranspose_regions): Separate code related to character semantics from that related to byte semantics and in that way leverage optimizations for regions of equal length with respect to both semantics. Move and update comments dating back to the initial implementation. * test/src/editfns-tests.el (editfns-tests--transpose-regions-tests) (editfns-tests--transpose-regions-markups) (editfns-tests--transpose-regions): New test and accompanying variables.
* (Ftranspose_regions): Fix bug#76124Stefan Monnier2025-07-061-0/+25
| | | | | | | * src/editfns.c (Ftranspose_regions): Be careful that ELisp code could move the gap from under our feet. * test/src/editfns-tests.el (editfns-tests--bug76124): New test.
* (decode_coding): Avoid nested *-change-functions (bug#78042)Stefan Monnier2025-05-021-4/+24
| | | | | | | | | | | | | * src/coding.c (decode_coding): Avoid nested *-change-functions (bug#78042). * test/src/editfns-tests.el (sanity-check-change-functions-before) (sanity-check-change-functions-after): Record notifications in `sanity-check-change-functions-op`. (sanity-check-change-functions-with-op): Don't rely on `sanity-check-change-functions-op` always holding only the `op`. (sanity-check-change-functions-errors): Include the sequence of notifications in the error info. (editfns-tests--before/after-change-functions): Add tests for (bug#78042).
* src/insdel.c (adjust_markers_for_replace): Fix insertion caseStefan Monnier2025-03-291-0/+14
| | | | test/src/editfns-tests.el (editfns-tests--insert-via-replace): New test
* (replace-region-contents): Improve and promote (bug#76313)Stefan Monnier2025-03-291-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Swap the role of `replace-region-contents` and `replace-buffer-contents`, so `replace-region-contents` is the main function, implemented in C, and `replace-buffer-contents` is a mere wrapper (marked as obsolete). Also remove the need to rely on narrowing and on describing the new text as a function. Finally, allow MAX-SECS==0 to require a cheap replacement, and add an INHERIT argument. * src/editfns.c: Include `coding.h`. (Freplace_region_contents): Rename from `Freplace_buffer_contents`. Change calling convention to that of `replace-region-contents`. Add more options for the SOURCE argument. Add INHERIT argument. Skip the costly algorithm if MAX-SECS is 0. * src/insdel.c (replace_range): Allow NEW to be a buffer. * lisp/subr.el (replace-buffer-contents): New implementation. * lisp/emacs-lisp/subr-x.el (replace-region-contents): Delete. * doc/lispref/text.texi (Replacing): Document new API for `replace-region-contents`. Remove documentation of `replace-buffer-contents`. * test/src/editfns-tests.el (replace-buffer-contents-1) (replace-buffer-contents-2, replace-buffer-contents-bug31837): Use `replace-region-contents`. (editfns--replace-region): Delete. (editfns-tests--replace-region): Use `replace-region-contents`. Adds tests for new types of SOURCE args.
* (Freplace_buffer_contents): Preserve markers more carefullyStefan Monnier2025-03-111-7/+9
| | | | | | | | | | | | | Use `replace_range` rather than `delete+insert`. * src/insdel.c (replace_range): Allow NEW to specify a chunk of buffer text. * src/editfns.c (Freplace_buffer_contents): Use it. * test/src/editfns-tests.el (replace-buffer-contents-1): Remove incorrect check which happened to succeed because point was not preserved carefully enough. Make the replacement text share a bit more content to make the test a bit more strict. (editfns-tests--replace-region): Doesn't fail any more.
* * test/src/editfns-tests.el (editfns--replace-region): New testStefan Monnier2025-02-281-0/+35
| | | | | This test fails, sadly, because `replace-buffer-contents` is not careful enough to something like `replace_range`.
* (Ftranspose_regions): Fix text-properties for len1==len2Stefan Monnier2025-02-231-0/+15
| | | | | | | | | | | | | When `len1_byte == len2_byte`, the code presumed that len1==len2 as well in its handling of text-properties. Fix that case. While at it, try and reduce code duplication by hoisting common code out of `if`s, and throw away the optimization for `len_mid == 0` which only saved 3 trivial function calls. * src/editfns.c (Ftranspose_regions): Shuffle the code a bit. * test/src/editfns-tests.el (editfns-tests--transpose-equal-but-not): New test.
* ; * test/src/editfns-tests.el (editfns-tests-styled-print): Fix last change.Eli Zaretskii2025-02-041-1/+0
|
* ; * test/src/editfns-tests.el (editfns-tests-styled-print): New test.Eli Zaretskii2025-02-041-0/+11
|
* Revert "; * src/dispnew.c (combine_updates_for_frame): Fix whitespace."Eli Zaretskii2025-01-241-10/+0
| | | | | This reverts commit c941b94e51f4e5996718416ac908249cb71da1d9. It was pushed by mistake.
* ; * src/dispnew.c (combine_updates_for_frame): Fix whitespace.Eli Zaretskii2025-01-241-0/+10
|
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* ; Fix whitespace in editfns-tests.elEli Zaretskii2024-04-111-1/+1
| | | | | * test/src/editfns-tests.el (editfns-tests--before/after-change-functions): Fix whitespace.
* (en/decode_coding_object): Fix `after-change-functions`Stefan Monnier2024-04-101-5/+39
| | | | | | | | | | | | | | | For `en/decode-coding-string/region`, `after-change-functions` were either not run at all, or run only after deleting the text but not after inserting it. * src/coding.c (decode_coding_object, encode_coding_object): Run the after-change-functions after inserting the result. * test/src/editfns-tests.el (sanity-check-change-functions-with-op): New macro. (sanity-check-change-functions-errors): New function. (editfns-tests--before/after-change-functions): Use them to add cases for `en/decode-coding-string/region`.
* (Freplace_match): Fix bug#65451Stefan Monnier2024-04-071-0/+74
| | | | | | | | | | | | | | | * src/search.c (Freplace_match): For ordering of *-change-functions. * test/src/editfns-tests.el (editfns-tests--before/after-change-functions): New test. (sanity-check--message, sanity-check-change-functions-error) (sanity-check-change-functions-check-size) (sanity-check-change-functions-before) (sanity-check-change-functions-after): New functions. (sanity-check--verbose, sanity-check-change-functions-beg) (sanity-check-change-functions-end) (sanity-check-change-functions-buffer-size) (sanity-check-change-functions-errors): New vars.
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Add some very rudimentary field-beginning/end testsLars Ingebrigtsen2021-12-191-0/+13
| |
* | Remove workaround for fixed Bug#6581 from ertStefan Kangas2021-10-311-24/+24
|/ | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-equal-including-properties): Make into obsolete function alias for 'equal-including-properties'. * test/src/editfns-tests.el (format-properties): * test/lisp/emacs-lisp/ert-x-tests.el (ert-propertized-string) (ert-test-run-tests-interactively-2): Don't use above obsolete name. (ert--explain-equal-including-properties-rec): New function. (ert--explain-equal-including-properties): Use as an explainer for 'equal-including-properties' now that Bug#6581 is fixed. * test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-equal-string-properties): Expand test. (ert-test-equal-including-properties): Merge test into above expanded test.
* ; Normalize and add missing first and last linesStefan Kangas2021-04-191-1/+1
|
* Improve wrong number of args error message in propertizeStefan Kangas2021-02-221-0/+4
| | | | | | | * src/editfns.c (Fpropertize): Improve error message. (syms_of_editfns) <Qpropertize>: New DEFSYM. * test/src/editfns-tests.el (propertize/error-wrong-number-of-args): New test.
* Fix copying text properties in 'format'Eli Zaretskii2021-02-061-1/+21
| | | | | | | | * src/editfns.c (styled_format): Fix accounting for text properties that come from the format string. (Bug#46317) * test/src/editfns-tests.el (format-properties): Add new tests for bug#46317.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Use lexical-binding in more testsStefan Kangas2020-08-291-3/+3
| | | | | | | | | | | | | | | | | * test/lib-src/emacsclient-tests.el: * test/lisp/emacs-lisp/hierarchy-tests.el: * test/lisp/eshell/eshell-tests.el: * test/lisp/gnus/gnus-util-tests.el: * test/lisp/progmodes/js-tests.el: * test/lisp/textmodes/bibtex-tests.el: * test/src/editfns-tests.el: * test/src/fns-tests.el: Use lexical-binding. * test/lisp/emacs-lisp/hierarchy-tests.el (hierarchy-leafs-includes-lonely-roots): * test/src/editfns-tests.el (transpose-test-get-byte-positions): * test/src/fns-tests.el (fns-tests-func-arity): Adjust for lexical-binding.
* ; Fix license statements.Stefan Kangas2020-08-271-3/+3
|
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Fix byte-counting error in ‘format’Paul Eggert2019-11-141-0/+4
| | | | | | | Problem reported by Paul Pogonyshev (Bug#38191). * src/editfns.c (styled_format): When checking for adjacent %-sequences, use byte position rather than character position. * test/src/editfns-tests.el (format-properties): Test for fix.
* Support "%x" etc. formats on more floatsPaul Eggert2019-07-231-11/+12
| | | | | | | | | | | | | | * doc/lispref/strings.texi (Formatting Strings): Document this. * src/editfns.c (styled_format): Support %o, %x, and %X on finite floats less than zero or greater than UINTMAX_MAX. * test/src/editfns-tests.el (format-%x-large-float) (read-large-integer, format-%o-negative-float): Adjust tests to match extended behavior. Rename the latter test from format-%o-invalid-float, since the float is no longer invalid. * test/src/editfns-tests.el (format-%x-large-float) (read-large-integer): Test this.
* * test/src/editfns-tests.el (test-group-name): Accept nil group-name.Stefan Monnier2019-07-021-8/+8
|
* * test/lisp/progmodes/python-tests.el: "Fix" failing testStefan Monnier2019-04-101-0/+3
| | | | (python-tests--python-nav-end-of-statement--infloop): Disable.
* Improve binary-as-unsigned treatment (Bug#34792)Paul Eggert2019-03-101-6/+5
| | | | | | | | | | * etc/NEWS: * src/editfns.c (Fformat, binary_as_unsigned): Update now that we always have bignums. (syms_of_editfns) [!defined lisp_h_FIXNUMP]: Remove now-obsolete code, since lisp_h_FIXNUMP is always defined now. * test/src/editfns-tests.el (read-large-integer): Simplify, now that we can assume binary-as-unsigned defaults to nil.
* Fix translation-region bug with MAX_CHARPaul Eggert2019-01-131-0/+9
| | | | | | | | | | | | Also, clean up the code a bit. Actually I discovered the bug while cleaning up the code. * src/editfns.c (Fsubst_char_in_region) (Ftranslate_region_internal): Use bool for booleans. (Ftranslate_region_internal): Fix off-by-1 bug when a translation table translates the maximum char. Assume C99 decl-after-statement, similar minor cleanups. * test/src/editfns-tests.el (test-translate-region-internal): New test.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | ; * test/src/editfns-tests.el (test-group-name): Ignore getent errors.Glenn Morris2018-11-101-2/+3
| |
* | * test/src/editfns-tests.el (test-group-name): Improve test.Glenn Morris2018-11-101-10/+17
| | | | | | | | Make more portable and hopefully more robust using getent. (Bug#33195)
* | * test/src/editfns-tests.el (test-group-name): Small fix.Glenn Morris2018-11-101-1/+1
| | | | | | | | Do not assume user 1000 has group name = user name.
* | Fix last changeEli Zaretskii2018-11-101-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/editfns.c (Fgroup_name): Fix the doc string. Move closer to the "group" functions. * src/w32.c (getgrgid): Return NULL if GID is not the group ID of the user of this Emacs session * test/src/editfns-tests.el (test-group-name): Rename from 'group-name'. Add tests for non-Posix hosts. Test error when the argument to group-name is invalid. * etc/NEWS: Fix wording of last added entry.