]> git.lizzy.rs Git - rust.git/commitdiff
tests: add normalize_doc_attributes config tests (#3630)
authorCaleb Cartwright <calebcartwright@users.noreply.github.com>
Sun, 16 Jun 2019 14:46:25 +0000 (09:46 -0500)
committerSeiichi Uchida <seuchida@gmail.com>
Sun, 16 Jun 2019 14:46:25 +0000 (23:46 +0900)
tests/source/configs/normalize_doc_attributes/false.rs [new file with mode: 0644]
tests/source/configs/normalize_doc_attributes/true.rs [new file with mode: 0644]
tests/target/configs/normalize_doc_attributes/false.rs [new file with mode: 0644]
tests/target/configs/normalize_doc_attributes/true.rs [new file with mode: 0644]

diff --git a/tests/source/configs/normalize_doc_attributes/false.rs b/tests/source/configs/normalize_doc_attributes/false.rs
new file mode 100644 (file)
index 0000000..f8eb642
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-normalize_doc_attributes: false
+// Normalize doc attributes
+
+#![doc = " Example documentation"]
+
+#[doc = " Example item documentation"]
+pub enum Foo {}
+
+#[doc = "        Lots of space"]
+pub enum Bar {}
+
+#[doc = "no leading space"]
+pub mod FooBar {}
diff --git a/tests/source/configs/normalize_doc_attributes/true.rs b/tests/source/configs/normalize_doc_attributes/true.rs
new file mode 100644 (file)
index 0000000..894c00a
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-normalize_doc_attributes: true
+// Normalize doc attributes
+
+#![doc = " Example documentation"]
+
+#[doc = " Example item documentation"]
+pub enum Foo {}
+
+#[doc = "        Lots of space"]
+pub enum Bar {}
+
+#[doc = "no leading space"]
+pub mod FooBar {}
diff --git a/tests/target/configs/normalize_doc_attributes/false.rs b/tests/target/configs/normalize_doc_attributes/false.rs
new file mode 100644 (file)
index 0000000..f8eb642
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-normalize_doc_attributes: false
+// Normalize doc attributes
+
+#![doc = " Example documentation"]
+
+#[doc = " Example item documentation"]
+pub enum Foo {}
+
+#[doc = "        Lots of space"]
+pub enum Bar {}
+
+#[doc = "no leading space"]
+pub mod FooBar {}
diff --git a/tests/target/configs/normalize_doc_attributes/true.rs b/tests/target/configs/normalize_doc_attributes/true.rs
new file mode 100644 (file)
index 0000000..fadab98
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-normalize_doc_attributes: true
+// Normalize doc attributes
+
+//! Example documentation
+
+/// Example item documentation
+pub enum Foo {}
+
+///        Lots of space
+pub enum Bar {}
+
+///no leading space
+pub mod FooBar {}