summaryrefslogtreecommitdiff
path: root/support/texlab/src/features/formatting
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-06-13 03:03:42 +0000
committerNorbert Preining <norbert@preining.info>2022-06-13 03:03:42 +0000
commitef6d63ded56fb892decaa8ab41d7deebbe670473 (patch)
tree9c8eccf2e633fcfe0ad512e5428222ce0707971e /support/texlab/src/features/formatting
parent86d0c4c6729cfb43e13fb29790810c3cc2521806 (diff)
CTAN sync 202206130303
Diffstat (limited to 'support/texlab/src/features/formatting')
-rw-r--r--support/texlab/src/features/formatting/bibtex_internal.rs134
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__command.snap8
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__concatenation.snap8
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__insert_braces.snap8
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__multiple_entries.snap9
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__parens.snap7
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__preamble.snap6
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__string.snap6
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__trailing_comma.snap8
-rw-r--r--support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__wrap_long_lines.snap10
10 files changed, 0 insertions, 204 deletions
diff --git a/support/texlab/src/features/formatting/bibtex_internal.rs b/support/texlab/src/features/formatting/bibtex_internal.rs
index 58aaf0635d..2dcc507be9 100644
--- a/support/texlab/src/features/formatting/bibtex_internal.rs
+++ b/support/texlab/src/features/formatting/bibtex_internal.rs
@@ -213,137 +213,3 @@ impl<'a> Formatter<'a> {
}
}
}
-
-#[cfg(test)]
-mod tests {
- use insta::{assert_debug_snapshot, assert_display_snapshot};
-
- use crate::features::testing::FeatureTester;
-
- use super::*;
-
- #[test]
- fn test_wrap_long_lines() {
- let request = FeatureTester::builder()
- .files(vec![(
- "main.bib",
- "@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}",
- )])
- .main("main.bib")
- .build()
- .formatting();
-
- let edit = format_bibtex_internal(&request).unwrap().pop().unwrap();
-
- assert_display_snapshot!(edit.new_text);
- }
-
- #[test]
- fn test_multiple_entries() {
- let request = FeatureTester::builder()
- .files(vec![(
- "main.bib",
- "@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}\n\n@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}",
- )])
- .main("main.bib")
- .build()
- .formatting();
-
- let mut edits = format_bibtex_internal(&request).unwrap();
- let edit2 = edits.pop().unwrap();
- let edit1 = edits.pop().unwrap();
-
- assert_debug_snapshot!((edit1.new_text, edit2.new_text));
- }
-
- #[test]
- fn test_trailing_comma() {
- let request = FeatureTester::builder()
- .files(vec![("main.bib", "@article{foo, bar = baz}")])
- .main("main.bib")
- .build()
- .formatting();
-
- let edit = format_bibtex_internal(&request).unwrap().pop().unwrap();
-
- assert_display_snapshot!(edit.new_text);
- }
-
- #[test]
- fn test_insert_braces() {
- let request = FeatureTester::builder()
- .files(vec![("main.bib", "@article{foo, bar = baz,")])
- .main("main.bib")
- .build()
- .formatting();
-
- let edit = format_bibtex_internal(&request).unwrap().pop().unwrap();
-
- assert_display_snapshot!(edit.new_text);
- }
-
- #[test]
- fn test_command() {
- let request = FeatureTester::builder()
- .files(vec![("main.bib", "@article{foo, bar = \"\\baz\",}")])
- .main("main.bib")
- .build()
- .formatting();
-
- let edit = format_bibtex_internal(&request).unwrap().pop().unwrap();
-
- assert_display_snapshot!(edit.new_text);
- }
-
- #[test]
- fn test_concatenation() {
- let request = FeatureTester::builder()
- .files(vec![("main.bib", "@article{foo, bar = \"baz\" # \"qux\"}")])
- .main("main.bib")
- .build()
- .formatting();
-
- let edit = format_bibtex_internal(&request).unwrap().pop().unwrap();
-
- assert_display_snapshot!(edit.new_text);
- }
-
- #[test]
- fn test_parens() {
- let request = FeatureTester::builder()
- .files(vec![("main.bib", "@article(foo,)")])
- .main("main.bib")
- .build()
- .formatting();
-
- let edit = format_bibtex_internal(&request).unwrap().pop().unwrap();
-
- assert_display_snapshot!(edit.new_text);
- }
-
- #[test]
- fn test_string() {
- let request = FeatureTester::builder()
- .files(vec![("main.bib", "@string{foo=\"bar\"}")])
- .main("main.bib")
- .build()
- .formatting();
-
- let edit = format_bibtex_internal(&request).unwrap().pop().unwrap();
-
- assert_display_snapshot!(edit.new_text);
- }
-
- #[test]
- fn test_preamble() {
- let request = FeatureTester::builder()
- .files(vec![("main.bib", "@preamble{\n\"foo bar baz\"}")])
- .main("main.bib")
- .build()
- .formatting();
-
- let edit = format_bibtex_internal(&request).unwrap().pop().unwrap();
-
- assert_display_snapshot!(edit.new_text);
- }
-}
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__command.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__command.snap
deleted file mode 100644
index 792e7be277..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__command.snap
+++ /dev/null
@@ -1,8 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: edit.new_text
-
----
-@article{foo,
- bar = "\baz",
-}
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__concatenation.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__concatenation.snap
deleted file mode 100644
index 8cd51dfa92..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__concatenation.snap
+++ /dev/null
@@ -1,8 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: edit.new_text
-
----
-@article{foo,
- bar = "baz" # "qux",
-}
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__insert_braces.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__insert_braces.snap
deleted file mode 100644
index 3be9b15e9d..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__insert_braces.snap
+++ /dev/null
@@ -1,8 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: edit.new_text
-
----
-@article{foo,
- bar = baz,
-}
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__multiple_entries.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__multiple_entries.snap
deleted file mode 100644
index 636b4b665c..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__multiple_entries.snap
+++ /dev/null
@@ -1,9 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: "(edit1.new_text, edit2.new_text)"
-
----
-(
- "@article{foo,\n\tbar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum\n\t dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet,\n\t consectetur adipiscing elit.},\n}",
- "@article{foo,\n\tbar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum\n\t dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet,\n\t consectetur adipiscing elit.},\n}",
-)
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__parens.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__parens.snap
deleted file mode 100644
index 5aff28cb5f..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__parens.snap
+++ /dev/null
@@ -1,7 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: edit.new_text
-
----
-@article{foo,
-}
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__preamble.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__preamble.snap
deleted file mode 100644
index 663569eb5b..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__preamble.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: edit.new_text
-
----
-@preamble{"foo bar baz"}
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__string.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__string.snap
deleted file mode 100644
index 6d37a69e8e..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__string.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: edit.new_text
-
----
-@string{foo = "bar"}
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__trailing_comma.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__trailing_comma.snap
deleted file mode 100644
index 3be9b15e9d..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__trailing_comma.snap
+++ /dev/null
@@ -1,8 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: edit.new_text
-
----
-@article{foo,
- bar = baz,
-}
diff --git a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__wrap_long_lines.snap b/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__wrap_long_lines.snap
deleted file mode 100644
index 6c0ec724b5..0000000000
--- a/support/texlab/src/features/formatting/snapshots/texlab__features__formatting__bibtex_internal__tests__wrap_long_lines.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: src/features/formatting/bibtex_internal.rs
-expression: edit.new_text
-
----
-@article{foo,
- bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum
- dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet,
- consectetur adipiscing elit.},
-}