Files
Roi MartinandEli Zaretskii 598a3604d4 Simplify fill-tests.el and add tests
Simplify fill-tests.el by grouping similar tests in the same
erts file.  Move the test code into the erts files, so it is
closer to the test cases, which provides context.  Add basic
test cases for common filling operations and for the scenarios
described in Bug#79575.

* test/lisp/textmodes/fill-tests.el (fill-test-end-period)
(fill-test-haskell): Rename from `test-fill-end-period' and
`test-fill-haskell' to follow the same naming convention of
the other tests.
(fill-test-fill-region-as-paragraph-default)
(fill-test-fill-region-as-paragraph-semlf)
(fill-test-fill-region-as-paragraph, fill-test-fill-region)
(fill-test-fill-paragraph, fill-test-fill-paragraph-semlf):
Group tests and move test code into erts files.
(fill-test-fill-paragraph-semlf-emacs-lisp-mode)
(fill-test-fill-paragraph-semlf-c-mode)
(fill-test-fill-paragraph-semlf-org-mode)
(fill-test-fill-paragraph-semlf-markdown-mode): Rename from
`fill-test-semlf-emacs-lisp-mode', `fill-test-semlf-c-mode',
`fill-test-semlf-org-mode' and
`fill-test-semlf-markdown-mode'.  Move test code into erts
files.
(fill-test-semlf, fill-test-semlf-fill-region)
(fill-test-semlf-justify)
(fill-test-semlf-sentence-end-double-space)
(fill-test-semlf-fill-column)
(fill-test-semlf-punctuation-marks, fill-test-semlf-twice)
(fill-test-semlf-fill-prefix, fill-test-semlf-indented-block)
(fill-test-semlf-revert): Delete tests since they are now
grouped with other tests.

* test/lisp/textmodes/fill-resources/fill-paragraph.erts:
* test/lisp/textmodes/fill-resources/fill-paragraph-semlf.erts:
* test/lisp/textmodes/fill-resources/fill-region-as-paragraph.erts:
* test/lisp/textmodes/fill-resources/fill-region-as-paragraph-default.erts:
* test/lisp/textmodes/fill-resources/fill-region-as-paragraph-semlf.erts:
Add test cases for the function specified in the file name,
including tests for the scenarios described in the bug report.
* test/lisp/textmodes/fill-resources/fill-region.erts: Add
test case for custom `fill-region-as-paragraph-function',
include test code in the test specification.
* test/lisp/textmodes/fill-resources/fill-paragraph-semlf-c-mode.erts:
* test/lisp/textmodes/fill-resources/
fill-paragraph-semlf-emacs-lisp-mode.erts:
* test/lisp/textmodes/fill-resources/fill-paragraph-semlf-markdown-mode.erts:
* test/lisp/textmodes/fill-resources/fill-paragraph-semlf-org-mode.erts:
Rename from semlf-*-mode.erts, prefix test names with the
tested function and include test code in the test
specification.
* test/lisp/textmodes/fill-resources/semlf-fill-column.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-prefix.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-region.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-region-as-paragraph.erts:
* test/lisp/textmodes/fill-resources/semlf-indented-block.erts:
* test/lisp/textmodes/fill-resources/semlf-justify.erts:
* test/lisp/textmodes/fill-resources/semlf-punctuation-marks.erts:
* test/lisp/textmodes/fill-resources/semlf-revert.erts:
* test/lisp/textmodes/fill-resources/semlf-sentence-end-double-space.erts:
* test/lisp/textmodes/fill-resources/semlf-twice.erts:
* test/lisp/textmodes/fill-resources/semlf.erts: Delete
files.  (Bug#79575)
2025-12-06 14:04:32 +02:00

129 lines
3.1 KiB
Plaintext

Point-Char: |
Name: fill-paragraph
Code:
(lambda ()
(setq-local fill-column 35)
(fill-paragraph))
=-=
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor. Incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor. Incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor. Incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
=-=
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor. Incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do
eiusmod tempor. Incididunt ut
labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi
ut.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor. Incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
=-=-=
Code:
(lambda ()
(setq-local sentence-end-double-space t)
(fill-paragraph))
Name: fill-paragraph - merge lines
=-=
abc def.
abc def.
=-=
abc def. abc def.
=-=-=
Name: fill-paragraph - merge lines with wide characters
=-=
あいうえお。
あいうえお。
=-=
あいうえお。あいうえお。
=-=-=
Code:
(lambda ()
(setq-local sentence-end-double-space nil)
(fill-paragraph))
Name: fill-paragraph - single space - merge lines
=-=
abc def.
abc def.
=-=
abc def. abc def.
=-=-=
Name: fill-paragraph - single space - merge lines with wide characters
=-=
あいうえお。
あいうえお。
=-=
あいうえお。あいうえお。
=-=-=
Name: fill-paragraph - fill-separate-heterogeneous-words-with-space (Bug#79575)
Code:
(lambda ()
(setq-local fill-separate-heterogeneous-words-with-space t)
(fill-paragraph))
=-=
abc def.
あいうえお。
=-=
abc def. あいうえお。
=-=-=
Name: fill-paragraph - single space - fill-separate-heterogeneous-words-with-space
Code:
(lambda ()
(setq-local fill-separate-heterogeneous-words-with-space t)
(setq-local sentence-end-double-space nil)
(fill-paragraph))
=-=
abc def.
あいうえお。
=-=
abc def. あいうえお。
=-=-=
Name: fill-paragraph - fill-region-as-paragraph-function
Code:
(lambda ()
(setq-local fill-region-as-paragraph-function
#'fill-region-as-paragraph-semlf)
(fill-paragraph))
=-=
|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor. Incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
=-=
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor.
Incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut.
=-=-=