From be2fe89b435628812d9fe752426c1efca647b422 Mon Sep 17 00:00:00 2001 From: Mark Amery Date: Wed, 13 Dec 2023 05:18:20 +0000 Subject: [PATCH] Add a bunch more cursor position test cases (#15787) --- .../cursor/__snapshots__/jsfmt.spec.js.snap | 327 ++++++++++++++++++ tests/format/html/cursor/cursor-0.html | 10 + tests/format/html/cursor/cursor-1.html | 15 + tests/format/html/cursor/cursor-2.html | 9 + tests/format/html/cursor/cursor-3.html | 9 + tests/format/html/cursor/cursor-4.html | 15 + tests/format/html/cursor/cursor-5.html | 9 + tests/format/html/cursor/cursor-6.html | 18 + tests/format/html/cursor/cursor-7.html | 16 + tests/format/html/cursor/cursor-8.html | 9 + tests/format/html/cursor/jsfmt.spec.js | 1 + .../cursor/__snapshots__/jsfmt.spec.js.snap | 117 +++++++ tests/format/js/cursor/cursor-11.js | 17 + tests/format/js/cursor/cursor-12.js | 17 + tests/format/js/cursor/cursor-13.js | 3 + 15 files changed, 592 insertions(+) create mode 100644 tests/format/html/cursor/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/format/html/cursor/cursor-0.html create mode 100644 tests/format/html/cursor/cursor-1.html create mode 100644 tests/format/html/cursor/cursor-2.html create mode 100644 tests/format/html/cursor/cursor-3.html create mode 100644 tests/format/html/cursor/cursor-4.html create mode 100644 tests/format/html/cursor/cursor-5.html create mode 100644 tests/format/html/cursor/cursor-6.html create mode 100644 tests/format/html/cursor/cursor-7.html create mode 100644 tests/format/html/cursor/cursor-8.html create mode 100644 tests/format/html/cursor/jsfmt.spec.js create mode 100644 tests/format/js/cursor/cursor-11.js create mode 100644 tests/format/js/cursor/cursor-12.js create mode 100644 tests/format/js/cursor/cursor-13.js diff --git a/tests/format/html/cursor/__snapshots__/jsfmt.spec.js.snap b/tests/format/html/cursor/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..ca29f0d28 --- /dev/null +++ b/tests/format/html/cursor/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,327 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`cursor-0.html format 1`] = ` +====================================options===================================== +cursorOffset: 354 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + +
bla bla + + +<|>
+ +=====================================output===================================== + +
bla blaiv> + +================================================================================ +`; + +exports[`cursor-1.html format 1`] = ` +====================================options===================================== +cursorOffset: 354 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + +
bla bla + + +<|>
+ + +=====================================output===================================== + +
bla blaiv> + + +================================================================================ +`; + +exports[`cursor-2.html format 1`] = ` +====================================options===================================== +cursorOffset: 48 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
bla bla + + +
+ + +=====================================output===================================== +
bla bla
+ + +================================================================================ +`; + +exports[`cursor-3.html format 1`] = ` +====================================options===================================== +cursorOffset: 43 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
bla bla + + +
+ + +=====================================output===================================== +
bla bla
+ + +================================================================================ +`; + +exports[`cursor-4.html format 1`] = ` +====================================options===================================== +cursorOffset: 399 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + +
bla bla + + +
+ + +=====================================output===================================== + +
bla bla
+ + +================================================================================ +`; + +exports[`cursor-5.html format 1`] = ` +====================================options===================================== +cursorOffset: 65 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
bla bla + + +
+ + +=====================================output===================================== +
bla bla
+ + +================================================================================ +`; + +exports[`cursor-6.html format 1`] = ` +====================================options===================================== +cursorOffset: 660 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + +
bla bla + + +
+ + +=====================================output===================================== + +
bla bla
+ + +================================================================================ +`; + +exports[`cursor-7.html format 1`] = ` +====================================options===================================== +cursorOffset: 470 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +
bla bla + + +
+ + +=====================================output===================================== + + +
bla bla
+ + +================================================================================ +`; + +exports[`cursor-8.html format 1`] = ` +====================================options===================================== +cursorOffset: 137 +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
bla bla + + +
+ diff --git a/tests/format/html/cursor/cursor-2.html b/tests/format/html/cursor/cursor-2.html new file mode 100644 index 000000000..21e8807ca --- /dev/null +++ b/tests/format/html/cursor/cursor-2.html @@ -0,0 +1,9 @@ +
bla bla + + +
+ diff --git a/tests/format/html/cursor/cursor-3.html b/tests/format/html/cursor/cursor-3.html new file mode 100644 index 000000000..11173af37 --- /dev/null +++ b/tests/format/html/cursor/cursor-3.html @@ -0,0 +1,9 @@ +
bla bla + + +
+ diff --git a/tests/format/html/cursor/cursor-4.html b/tests/format/html/cursor/cursor-4.html new file mode 100644 index 000000000..ae2f89a25 --- /dev/null +++ b/tests/format/html/cursor/cursor-4.html @@ -0,0 +1,15 @@ + +
bla bla + + +
+ diff --git a/tests/format/html/cursor/cursor-5.html b/tests/format/html/cursor/cursor-5.html new file mode 100644 index 000000000..ca072f71c --- /dev/null +++ b/tests/format/html/cursor/cursor-5.html @@ -0,0 +1,9 @@ +
bla bla + + +
+ diff --git a/tests/format/html/cursor/cursor-6.html b/tests/format/html/cursor/cursor-6.html new file mode 100644 index 000000000..af8b97999 --- /dev/null +++ b/tests/format/html/cursor/cursor-6.html @@ -0,0 +1,18 @@ + +
bla bla + + +
+ diff --git a/tests/format/html/cursor/cursor-7.html b/tests/format/html/cursor/cursor-7.html new file mode 100644 index 000000000..a326ec029 --- /dev/null +++ b/tests/format/html/cursor/cursor-7.html @@ -0,0 +1,16 @@ + + +
bla bla + + +
+ diff --git a/tests/format/html/cursor/cursor-8.html b/tests/format/html/cursor/cursor-8.html new file mode 100644 index 000000000..88bbd3a7d --- /dev/null +++ b/tests/format/html/cursor/cursor-8.html @@ -0,0 +1,9 @@ +
bla bla + + +
+