summaryrefslogtreecommitdiff
path: root/test/manual
diff options
context:
space:
mode:
Diffstat (limited to 'test/manual')
-rw-r--r--test/manual/biditest.el6
-rw-r--r--test/manual/cedet/cedet-utests.el12
-rw-r--r--test/manual/cedet/semantic-tests.el4
-rw-r--r--test/manual/cedet/tests/testnsp.cpp2
-rw-r--r--test/manual/etags/CTAGS.good2
-rw-r--r--test/manual/etags/c-src/abbrev.c14
-rw-r--r--test/manual/etags/c-src/emacs/src/keyboard.c2
-rw-r--r--test/manual/etags/cp-src/functions.cpp2
-rw-r--r--test/manual/etags/prol-src/ordsets.prolog4
-rw-r--r--test/manual/etags/tex-src/texinfo.tex4
-rw-r--r--test/manual/etags/y-src/parse.c2
-rw-r--r--test/manual/etags/y-src/parse.y2
-rw-r--r--test/manual/image-circular-tests.el144
-rw-r--r--test/manual/image-size-tests.el6
-rw-r--r--test/manual/image-transforms-tests.el52
-rw-r--r--test/manual/indent/css-mode.css96
-rw-r--r--test/manual/indent/js-chain.js29
-rw-r--r--test/manual/indent/js-indent-align-list-continuation-nil.js20
-rw-r--r--test/manual/indent/js-indent-init-dynamic.js30
-rw-r--r--test/manual/indent/js-indent-init-t.js21
-rw-r--r--test/manual/indent/js.js171
-rw-r--r--test/manual/indent/jsx-align-gt-with-lt.jsx12
-rw-r--r--test/manual/indent/jsx-comment-string.jsx23
-rw-r--r--test/manual/indent/jsx-indent-level.jsx13
-rw-r--r--test/manual/indent/jsx-quote.jsx16
-rw-r--r--test/manual/indent/jsx-self-closing.jsx13
-rw-r--r--test/manual/indent/jsx-unclosed-1.jsx13
-rw-r--r--test/manual/indent/jsx-unclosed-2.jsx65
-rw-r--r--test/manual/indent/jsx.jsx314
-rw-r--r--test/manual/indent/less-css-mode.less10
-rw-r--r--test/manual/indent/nxml.xml10
-rw-r--r--test/manual/indent/opascal.pas12
-rwxr-xr-xtest/manual/indent/perl.perl14
-rw-r--r--test/manual/indent/ps-mode.ps14
-rw-r--r--test/manual/indent/ruby.rb477
-rw-r--r--test/manual/indent/scheme.scm9
-rw-r--r--test/manual/indent/scss-mode.scss4
-rw-r--r--test/manual/indent/tcl.tcl26
-rw-r--r--test/manual/rmailmm.el93
-rw-r--r--test/manual/scroll-tests.el6
40 files changed, 252 insertions, 1517 deletions
diff --git a/test/manual/biditest.el b/test/manual/biditest.el
index 798bb182b88..dc78ef55b03 100644
--- a/test/manual/biditest.el
+++ b/test/manual/biditest.el
@@ -6,12 +6,14 @@
;; Maintainer: emacs-devel@gnu.org
;; Package: emacs
-;; This program is free software: you can redistribute it and/or modify
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
-;; This program is distributed in the hope that it will be useful,
+;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
diff --git a/test/manual/cedet/cedet-utests.el b/test/manual/cedet/cedet-utests.el
index 01839761f46..7805fce2d12 100644
--- a/test/manual/cedet/cedet-utests.el
+++ b/test/manual/cedet/cedet-utests.el
@@ -150,7 +150,7 @@ of just logging the error."
;; Cleanup stray input and events that are in the way.
;; Not doing this causes sit-for to not refresh the screen.
;; Doing this causes the user to need to press keys more frequently.
- (when (and (interactive-p) (input-pending-p))
+ (when (and (called-interactively-p 'interactive) (input-pending-p))
(if (fboundp 'read-event)
(read-event)
(read-char)))
@@ -497,11 +497,11 @@ When optional NO-ERROR don't throw an error if we can't run tests."
(error (concat "Pulse test only works on versions of Emacs"
" that support pulsing")))
;; Run the tests
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(message "<Press a key> Pulse one line.")
(read-char))
(pulse-momentary-highlight-one-line (point))
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(message "<Press a key> Pulse a region.")
(read-char))
(pulse-momentary-highlight-region (point)
@@ -510,11 +510,11 @@ When optional NO-ERROR don't throw an error if we can't run tests."
(forward-char 30)
(error nil))
(point)))
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(message "<Press a key> Pulse line a specific color.")
(read-char))
(pulse-momentary-highlight-one-line (point) 'mode-line)
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(message "<Press a key> Pulse a pre-existing overlay.")
(read-char))
(let* ((start (point-at-bol))
@@ -530,7 +530,7 @@ When optional NO-ERROR don't throw an error if we can't run tests."
(delete-overlay o)
(error "Non-temporary overlay was deleted!"))
)
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(message "Done!"))))
(provide 'cedet-utests)
diff --git a/test/manual/cedet/semantic-tests.el b/test/manual/cedet/semantic-tests.el
index 9d08a25b8ab..716bcc7abed 100644
--- a/test/manual/cedet/semantic-tests.el
+++ b/test/manual/cedet/semantic-tests.el
@@ -235,7 +235,7 @@ Analyze the area between BEG and END."
(set-buffer buff)
(semantic-lex-spp-write-test)
(kill-buffer buff)
- (when (not (interactive-p))
+ (when (not (called-interactively-p 'interactive))
(kill-buffer "*SPP Write Test*"))
)))
@@ -276,7 +276,7 @@ tag that contains point, and return that."
target (lambda (start end prefix) (setq Lcount (1+ Lcount)))
(semantic-tag-start tag)
(semantic-tag-end tag))
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(message "Found %d occurrences of %s in %.2f seconds"
Lcount (semantic-tag-name target)
(semantic-elapsed-time start nil)))
diff --git a/test/manual/cedet/tests/testnsp.cpp b/test/manual/cedet/tests/testnsp.cpp
index 8a7b2899f9a..db1603cead2 100644
--- a/test/manual/cedet/tests/testnsp.cpp
+++ b/test/manual/cedet/tests/testnsp.cpp
@@ -93,7 +93,7 @@ void foo(void) {
; // #4# ( "Mumble" "get" )
}
-// What happens if a type your looking for is scoped withing a type,
+// What happens if a type your looking for is scoped within a type,
// but you are one level into the completion so the originating scope
// excludes the type of the variable you are completing through?
// Thanks Martin Stein for this nice example.
diff --git a/test/manual/etags/CTAGS.good b/test/manual/etags/CTAGS.good
index 519315c6fdd..5e582434a62 100644
--- a/test/manual/etags/CTAGS.good
+++ b/test/manual/etags/CTAGS.good
@@ -1835,7 +1835,7 @@ Z c-src/h.h 100
\Ealphaenumerate tex-src/texinfo.tex /^\\def\\Ealphaenumerate{\\Eenumerate}$/
\Ecapsenumerate tex-src/texinfo.tex /^\\def\\Ecapsenumerate{\\Eenumerate}$/
\Ecartouche tex-src/texinfo.tex /^\\def\\Ecartouche{%$/
-\Edescription tex-src/texinfo.tex /^\\def\\Edescription{\\Etable}% Neccessary kludge.$/
+\Edescription tex-src/texinfo.tex /^\\def\\Edescription{\\Etable}% Necessary kludge.$/
\Edisplay tex-src/texinfo.tex /^\\def\\Edisplay{\\endgroup\\afterenvbreak}%$/
\Eexample tex-src/texinfo.tex /^\\def\\Eexample{\\Elisp}$/
\Eflushleft tex-src/texinfo.tex /^\\def\\Eflushleft{\\endgroup\\afterenvbreak}%$/
diff --git a/test/manual/etags/c-src/abbrev.c b/test/manual/etags/c-src/abbrev.c
index 4853824e434..039addc5a30 100644
--- a/test/manual/etags/c-src/abbrev.c
+++ b/test/manual/etags/c-src/abbrev.c
@@ -78,9 +78,6 @@ Lisp_Object Vlast_abbrev_text;
int last_abbrev_point;
-/* Hook to run before expanding any abbrev. */
-
-Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;
DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0,
"Create a new, empty abbrev table object.")
@@ -232,9 +229,6 @@ Returns the abbrev symbol, if expansion took place.")
value = Qnil;
- if (!NILP (Vrun_hooks))
- call1 (Vrun_hooks, Qpre_abbrev_expand_hook);
-
wordstart = 0;
if (!(BUFFERP (Vabbrev_start_location_buffer)
&& XBUFFER (Vabbrev_start_location_buffer) == current_buffer))
@@ -595,14 +589,6 @@ This causes `save-some-buffers' to offer to save the abbrevs.");
"*Set non-nil means expand multi-word abbrevs all caps if abbrev was so.");
abbrev_all_caps = 0;
- DEFVAR_LISP ("pre-abbrev-expand-hook", &Vpre_abbrev_expand_hook,
- "Function or functions to be called before abbrev expansion is done.\n\
-This is the first thing that `expand-abbrev' does, and so this may change\n\
-the current abbrev table before abbrev lookup happens.");
- Vpre_abbrev_expand_hook = Qnil;
- Qpre_abbrev_expand_hook = intern ("pre-abbrev-expand-hook");
- staticpro (&Qpre_abbrev_expand_hook);
-
defsubr (&Smake_abbrev_table);
defsubr (&Sclear_abbrev_table);
defsubr (&Sdefine_abbrev);
diff --git a/test/manual/etags/c-src/emacs/src/keyboard.c b/test/manual/etags/c-src/emacs/src/keyboard.c
index b1e9a755506..db86515ef09 100644
--- a/test/manual/etags/c-src/emacs/src/keyboard.c
+++ b/test/manual/etags/c-src/emacs/src/keyboard.c
@@ -5754,7 +5754,7 @@ make_lispy_event (struct input_event *event)
ignore_mouse_drag_p = 0;
}
- /* Now we're releasing a button - check the co-ordinates to
+ /* Now we're releasing a button - check the coordinates to
see if this was a click or a drag. */
else if (event->modifiers & up_modifier)
{
diff --git a/test/manual/etags/cp-src/functions.cpp b/test/manual/etags/cp-src/functions.cpp
index 7c353d161a1..ddd78f14d9b 100644
--- a/test/manual/etags/cp-src/functions.cpp
+++ b/test/manual/etags/cp-src/functions.cpp
@@ -223,7 +223,7 @@ int WorkingDays(Date a, Date b){
return(wdays);
}
-Date StartDay(Date a,int days){//Function to calculate the apropriate start day to finish in days working days
+Date StartDay(Date a,int days){//Function to calculate the appropriate start day to finish in days working days
Date tmp;
int wdays=0;
if ( ! a.set() )
diff --git a/test/manual/etags/prol-src/ordsets.prolog b/test/manual/etags/prol-src/ordsets.prolog
index 7192129fdce..0fa70f903f0 100644
--- a/test/manual/etags/prol-src/ordsets.prolog
+++ b/test/manual/etags/prol-src/ordsets.prolog
@@ -120,7 +120,7 @@ ord_intersect(>, Head1, Tail1, _, [Head2|Tail2]) :-
% ord_intersection(+Set1, +Set2, ?Intersection)
-% is true when Intersection is the intersecton of Set1
+% is true when Intersection is the intersection of Set1
% and Set2, provided that Set1 and Set2 are ordered sets.
ord_intersection([], _, []).
@@ -144,7 +144,7 @@ ord_intersection3([Head2|Tail2], Head1, Tail1, Intersection) :-
% ord_intersection(+Set1, +Set2, ?Intersection, ?Difference)
% is true when Intersection is the intersection of Set1 and Set2,
-% and Differens is Set2 \ Set1 (like in ord_union/4),
+% and Difference is Set2 \ Set1 (like in ord_union/4),
% provided that Set1 and Set2 are ordered sets.
ord_intersection([], Set2, [], Set2).
diff --git a/test/manual/etags/tex-src/texinfo.tex b/test/manual/etags/tex-src/texinfo.tex
index 9c80a2592d1..a04371d1c90 100644
--- a/test/manual/etags/tex-src/texinfo.tex
+++ b/test/manual/etags/tex-src/texinfo.tex
@@ -1074,7 +1074,7 @@ July\or August\or September\or October\or November\or December\fi
\def\tablez #1#2#3#4#5#6{%
\aboveenvbreak %
\begingroup %
-\def\Edescription{\Etable}% Neccessary kludge.
+\def\Edescription{\Etable}% Necessary kludge.
\let\itemindex=#1%
\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
\ifnum 0#4>0 \tableindent=#4\mil \fi %
@@ -2937,7 +2937,7 @@ July\or August\or September\or October\or November\or December\fi
\setbox0=\hbox{\printednodename}%
\ifdim \wd0=0pt%
\def\printednodename{\ignorespaces #1}%
-%%% Uncommment the following line to make the actual chapter or section title
+%%% Uncomment the following line to make the actual chapter or section title
%%% appear inside the square brackets.
%\def\printednodename{#1-title}%
\fi%
diff --git a/test/manual/etags/y-src/parse.c b/test/manual/etags/y-src/parse.c
index 4ea147fc026..f90d31505f0 100644
--- a/test/manual/etags/y-src/parse.c
+++ b/test/manual/etags/y-src/parse.c
@@ -1917,7 +1917,7 @@ yylex FUN0()
}
#ifdef TEST
if(nn==n_usr_funs) {
- io_error_msg("Couln't turn fp into a ##");
+ io_error_msg("Couldn't turn fp into a ##");
parse_error=BAD_FUNC;
return ERROR;
}
diff --git a/test/manual/etags/y-src/parse.y b/test/manual/etags/y-src/parse.y
index 75764bdc442..7985da525be 100644
--- a/test/manual/etags/y-src/parse.y
+++ b/test/manual/etags/y-src/parse.y
@@ -556,7 +556,7 @@ yylex FUN0()
}
#ifdef TEST
if(nn==n_usr_funs) {
- io_error_msg("Couln't turn fp into a ##");
+ io_error_msg("Couldn't turn fp into a ##");
parse_error=BAD_FUNC;
return ERROR;
}
diff --git a/test/manual/image-circular-tests.el b/test/manual/image-circular-tests.el
new file mode 100644
index 00000000000..28b5f892e53
--- /dev/null
+++ b/test/manual/image-circular-tests.el
@@ -0,0 +1,144 @@
+;;; image-tests.el --- Test suite for image-related functions.
+
+;; Copyright (C) 2019, 2021 Free Software Foundation, Inc.
+
+;; Author: Pip Cet <pipcet@gmail.com>
+;; Keywords: internal
+;; Human-Keywords: internal
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+
+(ert-deftest image-test-duplicate-keywords ()
+ "Test that duplicate keywords in an image spec lead to rejection."
+ (should-error (image-size `(image :type xbm :type xbm :width 1 :height 1
+ :data ,(bool-vector t))
+ t)))
+
+(ert-deftest image-test-circular-plist ()
+ "Test that a circular image spec is rejected."
+ (should-error
+ (let ((l `(image :type xbm :width 1 :height 1 :data ,(bool-vector t))))
+ (setcdr (last l) '#1=(:invalid . #1#))
+ (image-size l t))))
+
+(ert-deftest image-test-:type-property-value ()
+ "Test that :type is allowed as a property value in an image spec."
+ (should (equal (image-size `(image :dummy :type :type xbm :width 1 :height 1
+ :data ,(bool-vector t))
+ t)
+ (cons 1 1))))
+
+(ert-deftest image-test-circular-specs ()
+ "Test that circular image spec property values do not cause infinite recursion."
+ (should
+ (let* ((circ1 (cons :dummy nil))
+ (circ2 (cons :dummy nil))
+ (spec1 `(image :type xbm :width 1 :height 1
+ :data ,(bool-vector 1) :ignored ,circ1))
+ (spec2 `(image :type xbm :width 1 :height 1
+ :data ,(bool-vector 1) :ignored ,circ2)))
+ (setcdr circ1 circ1)
+ (setcdr circ2 circ2)
+ (and (equal (image-size spec1 t) (cons 1 1))
+ (equal (image-size spec2 t) (cons 1 1))))))
+
+(provide 'image-tests)
+;;; image-tests.el ends here.
+;;; image-tests.el --- tests for image.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'image)
+(eval-when-compile
+ (require 'cl-lib))
+
+(defconst image-tests--emacs-images-directory
+ (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY"))
+ "Directory containing Emacs images.")
+
+(ert-deftest image--set-property ()
+ "Test `image--set-property' behavior."
+ (let ((image (list 'image)))
+ ;; Add properties.
+ (setf (image-property image :scale) 1)
+ (should (equal image '(image :scale 1)))
+ (setf (image-property image :width) 8)
+ (should (equal image '(image :scale 1 :width 8)))
+ (setf (image-property image :height) 16)
+ (should (equal image '(image :scale 1 :width 8 :height 16)))
+ ;; Delete properties.
+ (setf (image-property image :type) nil)
+ (should (equal image '(image :scale 1 :width 8 :height 16)))
+ (setf (image-property image :scale) nil)
+ (should (equal image '(image :width 8 :height 16)))
+ (setf (image-property image :height) nil)
+ (should (equal image '(image :width 8)))
+ (setf (image-property image :width) nil)
+ (should (equal image '(image)))))
+
+(ert-deftest image-type-from-file-header-test ()
+ "Test image-type-from-file-header."
+ (should (eq (if (image-type-available-p 'svg) 'svg)
+ (image-type-from-file-header
+ (expand-file-name "splash.svg"
+ image-tests--emacs-images-directory)))))
+
+(ert-deftest image-rotate ()
+ "Test `image-rotate'."
+ (cl-letf* ((image (list 'image))
+ ((symbol-function 'image--get-imagemagick-and-warn)
+ (lambda () image)))
+ (let ((current-prefix-arg '(4)))
+ (call-interactively #'image-rotate))
+ (should (equal image '(image :rotation 270.0)))
+ (call-interactively #'image-rotate)
+ (should (equal image '(image :rotation 0.0)))
+ (image-rotate)
+ (should (equal image '(image :rotation 90.0)))
+ (image-rotate 0)
+ (should (equal image '(image :rotation 90.0)))
+ (image-rotate 1)
+ (should (equal image '(image :rotation 91.0)))
+ (image-rotate 1234.5)
+ (should (equal image '(image :rotation 245.5)))
+ (image-rotate -154.5)
+ (should (equal image '(image :rotation 91.0)))))
+
+;;; image-tests.el ends here
diff --git a/test/manual/image-size-tests.el b/test/manual/image-size-tests.el
index 42aab9d8c33..489b3972932 100644
--- a/test/manual/image-size-tests.el
+++ b/test/manual/image-size-tests.el
@@ -4,18 +4,18 @@
;; This file is part of GNU Emacs.
-;; This program is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
-;; This program is distributed in the hope that it will be useful,
+;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;; To test: Load the file and eval (image-size-tests).
;; A non-erroring result is a success.
diff --git a/test/manual/image-transforms-tests.el b/test/manual/image-transforms-tests.el
index 6be2913cac9..5342b5edcae 100644
--- a/test/manual/image-transforms-tests.el
+++ b/test/manual/image-transforms-tests.el
@@ -1,4 +1,4 @@
-;;; image-transform-tests.el --- Test suite for image transforms.
+;;; image-transform-tests.el --- Test suite for image transforms. -*- lexical-binding: t -*-
;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
@@ -48,24 +48,24 @@
(let ((image "<svg height='30' width='30'>
<rect x='0' y='0' width='10' height='10'/>
<rect x='10' y='10' width='10' height='10'
- style='fill:none;stroke-width:1;stroke:#000'/>
- <line x1='10' y1='10' x2='20' y2='20' style='stroke:#000'/>
- <line x1='20' y1='10' x2='10' y2='20' style='stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
+ <line x1='10' y1='10' x2='20' y2='20' style='stroke:currentColor'/>
+ <line x1='20' y1='10' x2='10' y2='20' style='stroke:currentColor'/>
<rect x='20' y='20' width='10' height='10'
- style='fill:none;stroke-width:1;stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
</svg>")
(top-left "<svg height='10' width='10'>
<rect x='0' y='0' width='10' height='10'/>
</svg>")
(middle "<svg height='10' width='10'>
<rect x='0' y='0' width='10' height='10'
- style='fill:none;stroke-width:1;stroke:#000'/>
- <line x1='0' y1='0' x2='10' y2='10' style='stroke:#000'/>
- <line x1='10' y1='0' x2='0' y2='10' style='stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
+ <line x1='0' y1='0' x2='10' y2='10' style='stroke:currentColor'/>
+ <line x1='10' y1='0' x2='0' y2='10' style='stroke:currentColor'/>
</svg>")
(bottom-right "<svg height='10' width='10'>
<rect x='0' y='0' width='10' height='10'
- style='fill:none;stroke-width:1;stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
</svg>"))
(insert-header "Test Crop: cropping an image (only works with ImageMagick)")
(insert-test "all params" top-left image '(:crop (10 10 0 0)))
@@ -77,23 +77,23 @@
(defun test-scaling ()
(let ((image "<svg height='10' width='10'>
<rect x='0' y='0' width='10' height='10'
- style='fill:none;stroke-width:1;stroke:#000'/>
- <line x1='0' y1='0' x2='10' y2='10' style='stroke:#000'/>
- <line x1='10' y1='0' x2='0' y2='10' style='stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
+ <line x1='0' y1='0' x2='10' y2='10' style='stroke:currentColor'/>
+ <line x1='10' y1='0' x2='0' y2='10' style='stroke:currentColor'/>
</svg>")
(large "<svg height='20' width='20'>
<rect x='0' y='0' width='20' height='20'
- style='fill:none;stroke-width:2;stroke:#000'/>
+ style='fill:none;stroke-width:2;stroke:currentColor'/>
<line x1='0' y1='0' x2='20' y2='20'
- style='stroke-width:2;stroke:#000'/>
+ style='stroke-width:2;stroke:currentColor'/>
<line x1='20' y1='0' x2='0' y2='20'
- style='stroke-width:2;stroke:#000'/>
+ style='stroke-width:2;stroke:currentColor'/>
</svg>")
(small "<svg height='5' width='5'>
<rect x='0' y='0' width='4' height='4'
- style='fill:none;stroke-width:1;stroke:#000'/>
- <line x1='0' y1='0' x2='4' y2='4' style='stroke:#000'/>
- <line x1='4' y1='0' x2='0' y2='4' style='stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
+ <line x1='0' y1='0' x2='4' y2='4' style='stroke:currentColor'/>
+ <line x1='4' y1='0' x2='0' y2='4' style='stroke:currentColor'/>
</svg>"))
(insert-header "Test Scaling: resize an image (pixelization may occur)")
(insert-test "1x" image image '(:scale 1))
@@ -107,27 +107,27 @@
(defun test-scaling-rotation ()
(let ((image "<svg height='20' width='20'>
<rect x='0' y='0' width='20' height='20'
- style='fill:none;stroke-width:1;stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
<rect x='0' y='0' width='10' height='10'
- style='fill:#000'/>
+ style='fill:currentColor'/>
</svg>")
(x2-90 "<svg height='40' width='40'>
<rect x='0' y='0' width='40' height='40'
- style='fill:none;stroke-width:1;stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
<rect x='20' y='0' width='20' height='20'
- style='fill:#000'/>
+ style='fill:currentColor'/>
</svg>")
(x2--90 "<svg height='40' width='40'>
<rect x='0' y='0' width='40' height='40'
- style='fill:none;stroke-width:1;stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
<rect x='0' y='20' width='20' height='20'
- style='fill:#000'/>
+ style='fill:currentColor'/>
</svg>")
(x0.5-180 "<svg height='10' width='10'>
<rect x='0' y='0' width='10' height='10'
- style='fill:none;stroke-width:1;stroke:#000'/>
+ style='fill:none;stroke-width:1;stroke:currentColor'/>
<rect x='5' y='5' width='5' height='5'
- style='fill:#000'/>
+ style='fill:currentColor'/>
</svg>"))
(insert-header "Test Scaling and Rotation: resize and rotate an image (pixelization may occur)")
(insert-test "1x, 0 degrees" image image '(:scale 1 :rotation 0))
diff --git a/test/manual/indent/css-mode.css b/test/manual/indent/css-mode.css
deleted file mode 100644
index ecf6c3c0ca5..00000000000
--- a/test/manual/indent/css-mode.css
+++ /dev/null
@@ -1,96 +0,0 @@
-/* asdfasdf */
-
-.xxx
-{
-}
-
-article[role="main"] {
- width: 60%;
-}
-
-a, b:hover, c {
- color: black !important;
-}
-
-a, b:hover { /* bug:20282 */
- c {
- color: black;
- }
- color: black;
-}
-
-a.b:c,d.e:f,g[h]:i,j[k]:l,.m.n:o,.p.q:r,.s[t]:u,.v[w]:x { /* bug:20282 */
- background-color: white;
-}
-
-/* asdfasdf */
-@foo x2 {
- bla:toto;
-}
-.x2
-{
- /* foo: bar; */ foo2: bar2;
- bar1: url("http://toto/titi");
- bar2: url('http://toto/titi');
- bar3: url(http://toto/titi);
-}
-
-div.x3
-{
-}
-
-article:hover
-{
- color: black;
-}
-
-/* bug:13425 */
-div:first-child,
-div:last-child,
-div[disabled],
-div::before {
- font: 15px "Helvetica Neue",
- Helvetica,
- Arial,
- "Nimbus Sans L",
- sans-serif;
- font: 15px "Helvetica Neue", Helvetica, Arial,
- "Nimbus Sans L", sans-serif;
- background: no-repeat right
- 5px center;
- transform: matrix(1.0, 2.0,
- 3.0, 4.0,
- 5.0, 6.0);
- transform: matrix(
- 1.0, 2.0,
- 3.0, 4.0,
- 5.0, 6.0
- );
-}
-
-/* Multi-line selector including both a pseudo-class and
- parenthesis. */
-.form-group:not(.required) label,
-.birth-date .row > * {
- &::after {
- display: inline;
- font-weight: normal;
- }
-}
-
-@font-face {
- src: url("Sans-Regular.eot") format("eot"),
- url("Sans-Regular.woff") format("woff"),
- url("Sans-Regular.ttf") format("truetype");
-}
-
-@font-face {
- src:
- url("Sans-Regular.eot") format("eot"),
- url("Sans-Regular.woff") format("woff");
-}
-
-.foo-bar--baz {
- --foo-variable: 5px;
- margin: var(--foo-variable);
-}
diff --git a/test/manual/indent/js-chain.js b/test/manual/indent/js-chain.js
deleted file mode 100644
index 2a290294026..00000000000
--- a/test/manual/indent/js-chain.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Normal chaining.
-let x = svg.mumble()
- .zzz;
-
-// Chaining with an intervening line comment.
-let x = svg.mumble() // line comment
- .zzz;
-
-// Chaining with multiple dots.
-let x = svg.selectAll().something()
- .zzz;
-
-// Nested chaining.
-let x = svg.selectAll(d3.svg.something()
- .zzz);
-
-// Nothing to chain to.
-let x = svg()
- .zzz;
-
-// Nothing to chain to.
-let x = svg().mumble.x() + 73
- .zzz;
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-chain-indent: t
-// js-indent-level: 2
-// End:
diff --git a/test/manual/indent/js-indent-align-list-continuation-nil.js b/test/manual/indent/js-indent-align-list-continuation-nil.js
deleted file mode 100644
index 383b2539a26..00000000000
--- a/test/manual/indent/js-indent-align-list-continuation-nil.js
+++ /dev/null
@@ -1,20 +0,0 @@
-const funcAssignment = function (arg1,
- arg2,
- arg3) {
- return { test: this,
- which: "would",
- align: "as well with the default setting"
- };
-}
-
-function funcDeclaration(arg1,
- arg2
-) {
- return [arg1,
- arg2];
-}
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-align-list-continuation: nil
-// End:
diff --git a/test/manual/indent/js-indent-init-dynamic.js b/test/manual/indent/js-indent-init-dynamic.js
deleted file mode 100644
index 536a976e86e..00000000000
--- a/test/manual/indent/js-indent-init-dynamic.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var foo = function() {
- return 7;
-};
-
-var foo = function() {
- return 7;
- },
- bar = 8;
-
-var foo = function() {
- return 7;
- },
- bar = function() {
- return 8;
- };
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// js-indent-first-init: dynamic
-// End:
-
-// The following test intentionally produces a scan error and should
-// be placed below all other tests to prevent awkward indentation.
-// (It still thinks it's within the body of a function.)
-
-var foo = function() {
- return 7;
- ,
- bar = 8;
diff --git a/test/manual/indent/js-indent-init-t.js b/test/manual/indent/js-indent-init-t.js
deleted file mode 100644
index bb755420ba7..00000000000
--- a/test/manual/indent/js-indent-init-t.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var foo = function() {
- return 7;
- };
-
-var foo = function() {
- return 7;
- },
- bar = 8;
-
-var foo = function() {
- return 7;
- },
- bar = function() {
- return 8;
- };
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// js-indent-first-init: t
-// End:
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
deleted file mode 100644
index 9658c95701c..00000000000
--- a/test/manual/indent/js.js
+++ /dev/null
@@ -1,171 +0,0 @@
-var a = 1;
-b = 2;
-
-let c = 1,
- d = 2;
-
-var e = 100500,
- + 1;
-
-// Don't misinterpret "const"
-/const/
-
-function test ()
-{
- return /[/]/.test ('/') // (bug#19397)
-}
-
-var f = bar('/protocols/')
-baz();
-
-var h = 100500
-1;
-
-const i = 1,
- j = 2;
-
-var k = 1,
- l = [
- 1, 2,
- 3, 4
- ],
- m = 5;
-
-var n = function() {
- return 7;
-},
- o = 8;
-
-foo(bar, function() {
- return 2;
-});
-
-switch (b) {
-case "a":
- 2;
-default:
- 3;
-}
-
-var p = {
- case: 'zzzz',
- default: 'donkey',
- tee: 'ornery'
-};
-
-var evens = [e for each (e in range(0, 21))
- if (ed % 2 == 0)];
-
-var funs = [
- function() {
- for (;;) {
- }
- },
- function(){},
-];
-
-!b
- !=b
- !==b
-
-a++
-b +=
- c
-
-var re = /some value/
-str.match(re)
-
-baz(`http://foo.bar/${tee}`)
- .qux();
-
-`multiline string
- contents
- are kept
- unchanged!`
-
-class A {
- * x() {
- return 1
- * a(2);
- }
-
- *[Symbol.iterator]() {
- yield "Foo";
- yield "Bar";
- }
-}
-
-if (true)
- 1
-else
- 2
-
-Foobar
- .find()
- .catch((err) => {
- return 2;
- })
- .then((num) => {
- console.log(num);
- });
-
-var z = [
- ...iterableObj,
- 4,
- 5
-]
-
-var arr = [
- -1, 2,
- -3, 4 +
- -5
-];
-
-// Regression test for bug#15582.
-if (x > 72 &&
- y < 85) { // found
- do_something();
-}
-
-// Test that chaining doesn't happen when js-chain-indent is nil.
-let x = svg.mumble()
- .zzz;
-
-// https://github.com/mooz/js2-mode/issues/405
-if (1) {
- isSet
- ? (isEmpty ? 2 : 3)
- : 4
-}
-
-// Regexp is not a continuation
-bar(
- "string arg1",
- /abc/
-)
-
-// No infloop inside js--re-search-backward-inner
-let b = {
- a : `
- //1
- `
-}
-
-// bug#25904
-foo.bar.baz(very => // A comment
- very
-).biz(([baz={a: [123]}, boz]) =>
- baz
-).snarf((snorf) => /* Another comment */
- snorf
-);
-
-// Continuation of bug#25904; support broken arrow as N+1th arg
-map(arr, (val) =>
- val
-)
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// End:
diff --git a/test/manual/indent/jsx-align-gt-with-lt.jsx b/test/manual/indent/jsx-align-gt-with-lt.jsx
deleted file mode 100644
index 8eb1d6d718c..00000000000
--- a/test/manual/indent/jsx-align-gt-with-lt.jsx
+++ /dev/null
@@ -1,12 +0,0 @@
-<element
- attr=""
- >
-</element>
-<input
- />
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// js-jsx-align->-with-<: nil
-// End:
diff --git a/test/manual/indent/jsx-comment-string.jsx b/test/manual/indent/jsx-comment-string.jsx
deleted file mode 100644
index cae023e7288..00000000000
--- a/test/manual/indent/jsx-comment-string.jsx
+++ /dev/null
@@ -1,23 +0,0 @@
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// End:
-
-// The following tests go below any comments to avoid including
-// misindented comments among the erroring lines.
-
-// The JSX-like text in comments/strings should be treated like the enclosing
-// syntax, not like JSX.
-
-// <Foo>
-void 0
-
-"<Bar>"
-void 0
-
-<Chicken>
- {/* <Pork> */}
- <Beef attr="<Turkey>">
- Yum!
- </Beef>
-</Chicken>
diff --git a/test/manual/indent/jsx-indent-level.jsx b/test/manual/indent/jsx-indent-level.jsx
deleted file mode 100644
index 0a84b9eb77a..00000000000
--- a/test/manual/indent/jsx-indent-level.jsx
+++ /dev/null
@@ -1,13 +0,0 @@
-return (
- <element>
- <element>
- Hello World!
- </element>
- </element>
-)
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 4
-// js-jsx-indent-level: 2
-// End:
diff --git a/test/manual/indent/jsx-quote.jsx b/test/manual/indent/jsx-quote.jsx
deleted file mode 100644
index 1b2c6528734..00000000000
--- a/test/manual/indent/jsx-quote.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-// JSX text node values should be strings, but only JS string syntax
-// is considered, so quote marks delimit strings like normal, with
-// disastrous results (https://github.com/mooz/js2-mode/issues/409).
-function Bug() {
- return <div>C'est Montréal</div>;
-}
-function Test(foo = /'/,
- bar = 123) {}
-
-// This test is in a separate file because it can break other tests
-// when indenting the whole buffer (not sure why).
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// End:
diff --git a/test/manual/indent/jsx-self-closing.jsx b/test/manual/indent/jsx-self-closing.jsx
deleted file mode 100644
index f8ea7a138ad..00000000000
--- a/test/manual/indent/jsx-self-closing.jsx
+++ /dev/null
@@ -1,13 +0,0 @@
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// End:
-
-// The following test goes below any comments to avoid including
-// misindented comments among the erroring lines.
-
-// Properly parse/indent code with a self-closing tag inside the
-// attribute of another self-closing tag.
-<div>
- <div attr={() => <div attr="" />} />
-</div>
diff --git a/test/manual/indent/jsx-unclosed-1.jsx b/test/manual/indent/jsx-unclosed-1.jsx
deleted file mode 100644
index 1f5c3fba8da..00000000000
--- a/test/manual/indent/jsx-unclosed-1.jsx
+++ /dev/null
@@ -1,13 +0,0 @@
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// End:
-
-// The following test goes below any comments to avoid including
-// misindented comments among the erroring lines.
-
-return (
- <div>
- {array.map(function () {
- return {
- a: 1
diff --git a/test/manual/indent/jsx-unclosed-2.jsx b/test/manual/indent/jsx-unclosed-2.jsx
deleted file mode 100644
index fb665b96a43..00000000000
--- a/test/manual/indent/jsx-unclosed-2.jsx
+++ /dev/null
@@ -1,65 +0,0 @@
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// End:
-
-// The following tests go below any comments to avoid including
-// misindented comments among the erroring lines.
-
-// Don’t misinterpret inequality operators as JSX.
-for (; i < length;) void 0
-if (foo > bar) void 0
-
-// Don’t misintrepet inequalities within JSX, either.
-<div>
- {foo < bar}
-</div>
-
-// Don’t even misinterpret unary operators as JSX.
-if (foo < await bar) void 0
-while (await foo > bar) void 0
-
-<div>
- {foo < await bar}
-</div>
-
-// Allow unary keyword names as null-valued JSX attributes.
-// (As if this will EVER happen…)
-<Foo yield>
- <Bar void>
- <Baz
- zorp
- typeof>
- <Please do_n0t delete this_stupidTest >
- How would we ever live without unary support
- </Please>
- </Baz>
- </Bar>
-</Foo>
-
-// “-” is not allowed in a JSXBoundaryElement’s name.
-<ABC />
- <A-B-C /> // Weirdly-indented “continued expression.”
-
-// “-” may be used in a JSXAttribute’s name.
-<Foo a-b-c=""
- x-y-z="" />
-
-// Weird spaces should be tolerated.
-< div >
- < div >
- < div
- attr=""
- / >
- < div
- attr=""
- / >
- < / div>
-< / div >
-
-// Non-ASCII identifiers are acceptable.
-<Über>
- <Québec διακριτικός sueño="">
- Guten Tag!
- </Québec>
-</Über>
diff --git a/test/manual/indent/jsx.jsx b/test/manual/indent/jsx.jsx
deleted file mode 100644
index c200979df8c..00000000000
--- a/test/manual/indent/jsx.jsx
+++ /dev/null
@@ -1,314 +0,0 @@
-var foo = <div></div>;
-
-return (
- <div>
- </div>
- <div>
- <div></div>
- <div>
- <div></div>
- </div>
- </div>
-);
-
-React.render(
- <div>
- <div></div>
- </div>,
- {
- a: 1
- },
- <div>
- <div></div>
- </div>
-);
-
-return (
- // Sneaky!
- <div></div>
-);
-
-return (
- <div></div>
- // Sneaky!
-);
-
-React.render(
- <input
- />,
- {
- a: 1
- }
-);
-
-return (
- <div>
- {array.map(function () {
- return {
- a: 1
- };
- })}
- </div>
-);
-
-return (
- <div attribute={array.map(function () {
- return {
- a: 1
- };
-
- return {
- a: 1
- };
-
- return {
- a: 1
- };
- })}>
- </div>
-);
-
-return (
- <div attribute={{
- a: 1, // Indent relative to “attribute” column.
- b: 2
- } && { // Dedent to “attribute” column.
- a: 1,
- b: 2
- }} /> // Also dedent.
-);
-
-return (
- <div attribute=
- { // Indent properly on another line, too.
- {
- a: 1,
- b: 2,
- } && (
- // Indent other forms, too.
- a ? b :
- c ? d :
- e
- )
- } />
-)
-
-// JSXMemberExpression names are parsed/indented:
-<Foo.Bar>
- <div>
- <Foo.Bar>
- Hello World!
- </Foo.Bar>
- <Foo.Bar>
- <div>
- </div>
- </Foo.Bar>
- </div>
-</Foo.Bar>
-
-// JSXOpeningFragment and JSXClosingFragment are parsed/indented:
-<>
- <div>
- <>
- Hello World!
- </>
- <>
- <div>
- </div>
- </>
- </div>
-</>
-
-// Indent void expressions (no need for contextual parens / commas)
-// (https://github.com/mooz/js2-mode/issues/140#issuecomment-166250016).
-<div className="class-name">
- <h2>Title</h2>
- {array.map(() => {
- return <Element />;
- })}
- {message}
-</div>
-// Another example of above issue
-// (https://github.com/mooz/js2-mode/issues/490).
-<App>
- <div>
- {variable1}
- <Component/>
- </div>
-</App>
-
-// Comments and arrows can break indentation (Bug#24896 /
-// https://github.com/mooz/js2-mode/issues/389).
-const Component = props => (
- <FatArrow a={e => c}
- b={123}>
- </FatArrow>
-);
-const Component = props => (
- <NoFatArrow a={123}
- b={123}>
- </NoFatArrow>
-);
-const Component = props => ( // Parse this comment, please.
- <FatArrow a={e => c}
- b={123}>
- </FatArrow>
-);
-const Component = props => ( // Parse this comment, please.
- <NoFatArrow a={123}
- b={123}>
- </NoFatArrow>
-);
-// Another example of above issue (Bug#30225).
-class {
- render() {
- return (
- <select style={{paddingRight: "10px"}}
- onChange={e => this.setState({value: e.target.value})}
- value={this.state.value}>
- <option>Hi</option>
- </select>
- );
- }
-}
-
-// JSX attributes of an arrow function’s expression body’s JSX
-// expression should be indented with respect to the JSX opening
-// element (Bug#26001 /
-// https://github.com/mooz/js2-mode/issues/389#issuecomment-271869380).
-class {
- render() {
- const messages = this.state.messages.map(
- message => <Message key={message.id}
- text={message.text}
- mine={message.mine} />
- ); return messages;
- }
- render() {
- const messages = this.state.messages.map(message =>
- <Message key={message.timestamp}
- text={message.text}
- mine={message.mine} />
- ); return messages;
- }
-}
-
-// Users expect tag closers to align with the tag’s start; this is the
-// style used in the React docs, so it should be the default.
-// - https://github.com/mooz/js2-mode/issues/389#issuecomment-390766873
-// - https://github.com/mooz/js2-mode/issues/482
-// - Bug#32158
-const foo = (props) => (
- <div>
- <input
- cat={i => i}
- />
- <button
- className="square"
- >
- {this.state.value}
- </button>
- </div>
-);
-
-// Embedded JSX in parens breaks indentation
-// (https://github.com/mooz/js2-mode/issues/411).
-let a = (
- <div>
- {condition && <Component/>}
- {condition && <Component/>}
- <div/>
- </div>
-)
-let b = (
- <div>
- {condition && (<Component/>)}
- <div/>
- </div>
-)
-let c = (
- <div>
- {condition && (<Component/>)}
- {condition && "something"}
- </div>
-)
-let d = (
- <div>
- {(<Component/>)}
- {condition && "something"}
- </div>
-)
-// Another example of the above issue (Bug#27000).
-function testA() {
- return (
- <div>
- <div> { ( <div/> ) } </div>
- </div>
- );
-}
-function testB() {
- return (
- <div>
- <div> { <div/> } </div>
- </div>
- );
-}
-// Another example of the above issue
-// (https://github.com/mooz/js2-mode/issues/451).
-class Classy extends React.Component {
- render () {
- return (
- <div>
- <ul className="tocListRoot">
- { this.state.list.map((item) => {
- return (<div />)
- })}
- </ul>
- </div>
- )
- }
-}
-
-// Self-closing tags should be indented properly
-// (https://github.com/mooz/js2-mode/issues/459).
-export default ({ stars }) => (
- <div className='overlay__container'>
- <div className='overlay__header overlay--text'>
- Congratulations!
- </div>
- <div className='overlay__reward'>
- <Icon {...createIconProps(stars > 0)} size='large' />
- <div className='overlay__reward__bottom'>
- <Icon {...createIconProps(stars > 1)} size='small' />
- <Icon {...createIconProps(stars > 2)} size='small' />
- </div>
- </div>
- <div className='overlay__description overlay--text'>
- You have created <large>1</large> reminder
- </div>
- </div>
-)
-
-// JS expressions should not break indentation
-// (https://github.com/mooz/js2-mode/issues/462).
-//
-// In the referenced issue, the user actually wanted indentation which
-// was simply different than Emacs’ SGML attribute indentation.
-// Nevertheless, his issue highlighted our inability to properly
-// indent code with JSX inside JSXExpressionContainers inside JSX.
-return (
- <Router>
- <Bar>
- <Route exact path="/foo"
- render={() => (
- <div>nothing</div>
- )} />
- <Route exact path="/bar" />
- </Bar>
- </Router>
-)
-
-// Local Variables:
-// indent-tabs-mode: nil
-// js-indent-level: 2
-// End:
diff --git a/test/manual/indent/less-css-mode.less b/test/manual/indent/less-css-mode.less
index 36c037450cc..b40a2362e28 100644
--- a/test/manual/indent/less-css-mode.less
+++ b/test/manual/indent/less-css-mode.less
@@ -1,3 +1,13 @@
+@var-with-dashes: #428bca;
+@var_with_underscores: 10px;
+@_var-starting-with-underscore: none;
+
+body {
+ background: @var-with-dashes;
+ padding: @var_with_underscores;
+ display: @_var-starting-with-underscore;
+}
+
.desktop-and-old-ie(@rules) {
@media screen and (min-width: 1200) { @rules(); }
html.lt-ie9 & { @rules(); }
diff --git a/test/manual/indent/nxml.xml b/test/manual/indent/nxml.xml
deleted file mode 100644
index 61b84f270b0..00000000000
--- a/test/manual/indent/nxml.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<spocosy version="1.0" responsetime="2011-03-15 13:53:12" exec="0.171">
- <!--
- <query-response requestid="" service="objectquery">
- <sport name="Soccer" enetSportCode="s" del="no" n="1" ut="2009-12-29
- 15:36:24" id="1">
- </sport>
- </query-response>
- -->
-</spocosy>
diff --git a/test/manual/indent/opascal.pas b/test/manual/indent/opascal.pas
deleted file mode 100644
index ac4beb3f840..00000000000
--- a/test/manual/indent/opascal.pas
+++ /dev/null
@@ -1,12 +0,0 @@
-{ -*- opascal -*- }
-
-procedure Toto ();
-begin
- for i := 0 to 1 do
- Write (str.Chars[i]);
-
- // bug#36348
- for var i := 0 to 1 do
- Write (str.Chars[i]);
-
-end;
diff --git a/test/manual/indent/perl.perl b/test/manual/indent/perl.perl
index 853aec49245..6ec04303b4f 100755
--- a/test/manual/indent/perl.perl
+++ b/test/manual/indent/perl.perl
@@ -81,3 +81,17 @@ return 'W' if #/^Not Available on Mobile/m; #W=Web only
# A "y|abc|def|" shouldn't interfere when inside a string!
$toto = " x \" string\"";
$toto = " y \" string\""; # This is not the `y' operator!
+
+
+# Tricky cases from Harald Jörg <haj@posteo.de>
+$_ = "abcabc\n";
+s:abc:def:g; # FIXME: the initial s is fontified like a label, and indented
+
+s'def'ghi'g; # The middle ' should not end the quoting.
+s"ghi"ijk"g; # The middle ' should not end the quoting.
+
+s#ijk#lmn#g; # This is a regular expression sustitution.
+
+s #lmn#opq#g; # FIXME: this should be a comment starting with "#lmn"
+ /lmn/rst/g; # and this is the actual regular expression
+print; # prints "rstrst\n"
diff --git a/test/manual/indent/ps-mode.ps b/test/manual/indent/ps-mode.ps
deleted file mode 100644
index 4b4ee0f10cb..00000000000
--- a/test/manual/indent/ps-mode.ps
+++ /dev/null
@@ -1,14 +0,0 @@
-%!PS-2.0
-
-<< 23 45 >> %dictionary
-< 23 > %hex string
-<~a>a%a~> %base85 string
-(%)s
-(sf\(g>a)sdg)
-
-/foo {
- <<
- hello 2
- 3
- >>
-} def
diff --git a/test/manual/indent/ruby.rb b/test/manual/indent/ruby.rb
deleted file mode 100644
index b038512b114..00000000000
--- a/test/manual/indent/ruby.rb
+++ /dev/null
@@ -1,477 +0,0 @@
-if something_wrong? # ruby-move-to-block-skips-heredoc
- ActiveSupport::Deprecation.warn(<<-eowarn)
- boo hoo
- end
- eowarn
- foo
-
- foo(<<~squiggly)
- end
- squiggly
-end
-
-def foo
- %^bar^
-end
-
-# Percent literals.
-b = %Q{This is a "string"}
-c = %w!foo
- bar
- baz!
-d = %(hello (nested) world)
-
-# Don't propertize percent literals inside strings.
-"(%s, %s)" % [123, 456]
-
-"abc/#{ddf}ghi"
-"abc\#{ddf}ghi"
-
-# Or inside comments.
-x = # "tot %q/to"; =
- y = 2 / 3
-
-# Regexp after whitelisted method.
-"abc".sub /b/, 'd'
-
-# Don't mis-match "sub" at the end of words.
-a = asub / aslb + bsub / bslb;
-
-# Highlight the regexp after "if".
-x = toto / foo if /do bar/ =~ "dobar"
-
-# Regexp options are highlighted.
-
-/foo/xi != %r{bar}mo.tee
-
-foo { /"tee/
- bar { |qux| /'fee"/ } # bug#20026
-}
-
-bar(class: XXX) do # ruby-indent-keyword-label
- foo
-end
-bar
-
-foo = [1, # ruby-deep-indent
- 2]
-
-foo = { # ruby-deep-indent-disabled
- a: b
-}
-
-foo = { a: b,
- a1: b1
- }
-
-foo({ # bug#16118
- a: b,
- c: d
- })
-
-bar = foo(
- a, [
- 1,
- ],
- :qux => [
- 3
- ])
-
-foo(
- [
- {
- a: b
- },
- ],
- {
- c: d
- }
-)
-
-foo([{
- a: 2
- },
- {
- b: 3
- },
- 4
- ])
-
-foo = [ # ruby-deep-indent-disabled
- 1
-]
-
-foo( # ruby-deep-indent-disabled
- a
-)
-
-# Multiline regexp.
-/bars
- tees # toots
- nfoos/
-
-def test1(arg)
- puts "hello"
-end
-
-def test2 (arg)
- a = "apple"
-
- if a == 2
- puts "hello"
- else
- puts "there"
- end
-
- if a == 2 then
- puts "hello"
- elsif a == 3
- puts "hello3"
- elsif a == 3 then
- puts "hello3"
- else
- puts "there"
- end
-
- b = case a
- when "a"
- 6
- # Support for this syntax was removed in Ruby 1.9, so we
- # probably don't need to handle it either.
- # when "b" :
- # 7
- # when "c" : 2
- when "d" then 4
- else 5
- end
-end
-
-# Some Cucumber code:
-Given /toto/ do
- print "hello"
-end
-
-# Bug#15208
-if something == :==
- do_something
-
- return false unless method == :+
- x = y + z # Bug#16609
-
- a = 1 ? 2 :(
- 2 + 3
- )
-end
-
-# Bug#17097
-if x == :!=
- something
-end
-
-qux :+,
- bar,
- :[]=,
- bar,
- :a
-
-b = $:
-c = ??
-
-# Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
-d = 4 + 5 + # no '\' needed
- 6 + 7
-
-# Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
-e = 8 + 9 \
- + 10 # '\' needed
-
-foo = obj.bar { |m| tee(m) } +
- obj.qux { |m| hum(m) }
-
-begin
- foo
-ensure
- bar
-end
-
-# Bug#15369
-MSG = 'Separate every 3 digits in the integer portion of a number' \
- 'with underscores(_).'
-
-class C
- def foo
- self.end
- D.new.class
- end
-
- def begin
- end
-end
-
-a = foo(j, k) -
- bar_tee
-
-while a < b do # "do" is optional
- foo
-end
-
-desc "foo foo" \
- "bar bar"
-
-foo.
- bar
-
-# https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206
-foo # comment intended to confuse the tokenizer
- .bar
-
-z = {
- foo: {
- a: "aaa",
- b: "bbb"
- }
-}
-
-foo if
- bar
-
-fail "stuff" \
- unless all_fine?
-
-if foo?
- bar
-end
-
-method arg1, # bug#15594
- method2 arg2,
- arg3
-
-method? arg1,
- arg2
-
-method! arg1,
- arg2
-
-method !arg1,
- arg2
-
-method [],
- arg2
-
-method :foo,
- :bar
-
-method (a + b),
- c, :d => :e,
- f: g
-
-desc "abc",
- defg
-
-it "is a method call with block" do |asd|
- foo
-end
-
-it("is too!") {
- bar
- .qux
-}
-
-and_this_one(has) { |block, parameters|
- tee
-}
-
-if foo &&
- bar
-end
-
-foo +
- bar
-
-foo and
- bar
-
-foo > bar &&
- tee < qux
-
-zux do
- foo == bar &&
- tee == qux
-
- a = 3 and
- b = 4
-end
-
-foo + bar ==
- tee + qux
-
-1 .. 2 &&
- 3
-
-3 < 4 +
- 5
-
-10 << 4 ^
- 20
-
-100 + 2 >>
- 3
-
-2 ** 10 /
- 2
-
-foo ^
- bar
-
-foo_bar_tee(1, 2, 3)
- .qux&.bar
- .tee.bar
- &.tee
-
-foo do
- bar
- .tee
-end
-
-def bar
- foo
- .baz
-end
-
-abc(foo
- .bar,
- tee
- .qux)
-
-# http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
-tee = if foo
- bar
- else
- tee
- end
-
-a = b {
- c
-}
-
-aa = bb do
- cc
-end
-
-foo :bar do
- qux
-end
-
-foo do |*args|
- tee
-end
-
-bar do |&block|
- tee
-end
-
-foo = [1, 2, 3].map do |i|
- i + 1
-end
-
-bar.foo do
- bar
-end
-
-bar.foo(tee) do
- bar
-end
-
-bar.foo(tee) {
- bar
-}
-
-bar 1 do
- foo 2 do
- tee
- end
-end
-
-foo |
- bar
-
-def qux
- foo ||= begin
- bar
- tee
- rescue
- oomph
- end
-end
-
-private def foo
- bar
-end
-
-%^abc^
-ddd
-
-qux = foo.fee ?
- bar :
- tee
-
-zoo.keep.bar!(
- {x: y,
- z: t})
-
-zoo
- .lose(
- q, p)
-
-a.records().map(&:b).zip(
- foo)
-
-foo1 =
- subject.update(
- 1
- )
-
-foo2 =
- subject.
- update(
- 2
- )
-
-# FIXME: This is not consistent with the example below it, but this
-# offset only happens if the colon is at eol, which wouldn't be often.
-# Tokenizing `bar:' as `:bar =>' would be better, but it's hard to
-# distinguish from a variable reference inside a ternary operator.
-foo(bar:
- tee)
-
-foo(:bar =>
- tee)
-
-regions = foo(
- OpenStruct.new(id: 0, name: "foo") => [
- 10
- ]
-)
-
-{'a' => {
- 'b' => 'c',
- 'd' => %w(e f)
- }
-}
-
-# Bug#17050
-
-return render json: {
- errors: { base: [message] },
- copying: copying
- },
- status: 400
-
-top test(
- some,
- top,
- test)
-
-foo bar, {
- tee: qux
- }
diff --git a/test/manual/indent/scheme.scm b/test/manual/indent/scheme.scm
deleted file mode 100644
index 84d0f6d8786..00000000000
--- a/test/manual/indent/scheme.scm
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/scheme is this a comment?
-
-;; This one is a comment
-(a)
-#| and this one as #|well|# as this! |#
-(b)
-(cons #;(this is a
- comment)
- head tail)
diff --git a/test/manual/indent/scss-mode.scss b/test/manual/indent/scss-mode.scss
index a3dd41eeb47..189ec4e22ac 100644
--- a/test/manual/indent/scss-mode.scss
+++ b/test/manual/indent/scss-mode.scss
@@ -41,9 +41,13 @@ p.#{$name} var
article[role="main"] {
$toto: 500 !global;
$var-with-default: 300 !default;
+ $var_with_underscores: #fff;
+ $_var-starting-with-underscore: none;
float: left !important;
width: 600px / 888px * 100%;
height: 100px / 888px * 100%;
+ color: $var_with_underscores;
+ display: $_var-starting-with-underscore;
}
%placeholder {
diff --git a/test/manual/indent/tcl.tcl b/test/manual/indent/tcl.tcl
new file mode 100644
index 00000000000..f055be19663
--- /dev/null
+++ b/test/manual/indent/tcl.tcl
@@ -0,0 +1,26 @@
+# Some sample code that tries to exercise the font-lock
+# of various forms of writing strings.
+
+puts "hello}"; # Top-level strings can contain unescaped closing braces!
+
+puts a"b; # Non-delimited strings can contain quotes!
+puts a""b; # Even several of them!
+
+proc foo1 {} {
+ puts "hello"; # Normal case!
+ puts "hello\}; # This will signal an error when `foo1` is called!
+}
+
+proc foo2 {} {
+ puts "hello; # This will also signal an error when `foo2` is called!
+}
+
+proc foo3 {} {
+ puts a"b; # This will not signal an error!
+ puts a""b"; # And that won't either!
+ puts "a""b"; # But this will!
+}
+
+# FIXME: The [..] interpolation within "..." strings is not properly
+# handled by the current `syntax-propertize-function`!
+set a "Testing: [split "192.168.1.1/24" "/"] address";
diff --git a/test/manual/rmailmm.el b/test/manual/rmailmm.el
deleted file mode 100644
index 6cfeb16e5b2..00000000000
--- a/test/manual/rmailmm.el
+++ /dev/null
@@ -1,93 +0,0 @@
-;;; rmailmm.el --- tests for mail/rmailmm.el
-
-;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; Code:
-
-(require 'rmailmm)
-
-(defun rmailmm-test-handler ()
- "Test of a mail using no MIME parts at all."
- (let ((mail "To: alex@gnu.org
-Content-Type: text/plain; charset=koi8-r
-Content-Transfer-Encoding: 8bit
-MIME-Version: 1.0
-
-\372\304\322\301\327\323\324\327\325\312\324\305\41"))
- (switch-to-buffer (get-buffer-create "*test*"))
- (erase-buffer)
- (set-buffer-multibyte nil)
- (insert mail)
- (rmail-mime-show t)
- (set-buffer-multibyte t)))
-
-(defun rmailmm-test-bulk-handler ()
- "Test of a mail used as an example in RFC 2183."
- (let ((mail "Content-Type: image/jpeg
-Content-Disposition: attachment; filename=genome.jpeg;
- modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\";
-Content-Description: a complete map of the human genome
-Content-Transfer-Encoding: base64
-
-iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAZQ
-TFRF////AAAAVcLTfgAAAPZJREFUeNq9ldsOwzAIQ+3//+l1WlvA5ZLsoUiTto4TB+ISoAjy
-+ITfRBfcAmgRFFeAm+J6uhdKdFhFWUgDkFsK0oUp/9G2//Kj7Jx+5tSKOdBscgUYiKHRS/me
-WATQdRUvAK0Bnmshmtn79PpaLBbbOZkjKvRnjRZoRswOkG1wFchKew2g9wXVJVZL/m4+B+vv
-9AxQQR2Q33SgAYJzzVACdAWjAfRYzYFO9n6SLnydtQHSMxYDMAKqZ/8FS/lTK+zuq3CtK64L
-UDwbgUEAUmk2Zyg101d6PhCDySgAvTvDgKiuOrc4dLxUb7UMnhGIexyI+d6U+ABuNAP4Simx
-lgAAAABJRU5ErkJggg==
-"))
- (switch-to-buffer (get-buffer-create "*test*"))
- (erase-buffer)
- (insert mail)
- (rmail-mime-show)))
-
-(defun rmailmm-test-multipart-handler ()
- "Test of a mail used as an example in RFC 2046."
- (let ((mail "From: Nathaniel Borenstein <nsb@bellcore.com>
-To: Ned Freed <ned@innosoft.com>
-Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)
-Subject: Sample message
-MIME-Version: 1.0
-Content-type: multipart/mixed; boundary=\"simple boundary\"
-
-This is the preamble. It is to be ignored, though it
-is a handy place for composition agents to include an
-explanatory note to non-MIME conformant readers.
-
---simple boundary
-
-This is implicitly typed plain US-ASCII text.
-It does NOT end with a linebreak.
---simple boundary
-Content-type: text/plain; charset=us-ascii
-
-This is explicitly typed plain US-ASCII text.
-It DOES end with a linebreak.
-
---simple boundary--
-
-This is the epilogue. It is also to be ignored."))
- (switch-to-buffer (get-buffer-create "*test*"))
- (erase-buffer)
- (insert mail)
- (rmail-mime-show t)))
-
-;;; rmailmm.el ends here
diff --git a/test/manual/scroll-tests.el b/test/manual/scroll-tests.el
index 0fa5818d7af..2f40b2bb696 100644
--- a/test/manual/scroll-tests.el
+++ b/test/manual/scroll-tests.el
@@ -4,18 +4,18 @@
;; This file is part of GNU Emacs.
-;; This program is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
-;; This program is distributed in the hope that it will be useful,
+;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary: