diff --git a/tests/source/issue-3984/imports_granularity_crate.rs b/tests/source/issue-3984/imports_granularity_crate.rs new file mode 100644 index 00000000000..e45cd5cbe0a --- /dev/null +++ b/tests/source/issue-3984/imports_granularity_crate.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: Crate + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item /* comment */; +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/source/issue-3984/imports_granularity_item.rs b/tests/source/issue-3984/imports_granularity_item.rs new file mode 100644 index 00000000000..4d950d5de4f --- /dev/null +++ b/tests/source/issue-3984/imports_granularity_item.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: Item + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item /* comment */; +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/source/issue-3984/imports_granularity_module.rs b/tests/source/issue-3984/imports_granularity_module.rs new file mode 100644 index 00000000000..0ec9f6b595b --- /dev/null +++ b/tests/source/issue-3984/imports_granularity_module.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: Module + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item /* comment */; +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/source/issue-3984/imports_granularity_one.rs b/tests/source/issue-3984/imports_granularity_one.rs new file mode 100644 index 00000000000..87c2997f886 --- /dev/null +++ b/tests/source/issue-3984/imports_granularity_one.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: One + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item /* comment */; +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/source/issue-3984/imports_granularity_preserve.rs b/tests/source/issue-3984/imports_granularity_preserve.rs new file mode 100644 index 00000000000..4e51d186a94 --- /dev/null +++ b/tests/source/issue-3984/imports_granularity_preserve.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: Preserve + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item /* comment */; +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/target/issue-3984/imports_granularity_crate.rs b/tests/target/issue-3984/imports_granularity_crate.rs new file mode 100644 index 00000000000..0dd087e322f --- /dev/null +++ b/tests/target/issue-3984/imports_granularity_crate.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: Crate + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item; /* comment */ +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/target/issue-3984/imports_granularity_item.rs b/tests/target/issue-3984/imports_granularity_item.rs new file mode 100644 index 00000000000..a5f0f7dac86 --- /dev/null +++ b/tests/target/issue-3984/imports_granularity_item.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: Item + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item; /* comment */ +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/target/issue-3984/imports_granularity_module.rs b/tests/target/issue-3984/imports_granularity_module.rs new file mode 100644 index 00000000000..2ce31a0ee94 --- /dev/null +++ b/tests/target/issue-3984/imports_granularity_module.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: Module + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item; /* comment */ +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/target/issue-3984/imports_granularity_one.rs b/tests/target/issue-3984/imports_granularity_one.rs new file mode 100644 index 00000000000..ee7af1f045e --- /dev/null +++ b/tests/target/issue-3984/imports_granularity_one.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: One + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item; /* comment */ +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */}; diff --git a/tests/target/issue-3984/imports_granularity_preserve.rs b/tests/target/issue-3984/imports_granularity_preserve.rs new file mode 100644 index 00000000000..639c03f4980 --- /dev/null +++ b/tests/target/issue-3984/imports_granularity_preserve.rs @@ -0,0 +1,15 @@ +// rustfmt-imports_granularity: Preserve + +// See https://github.com/rust-lang/rustfmt/issues/3984 +use a::{item /* comment */}; +use b::{ + a, + // comment + item, +}; +use c::item; /* comment */ +use d::item; // really long comment (with `use` exactly 100 characters) ____________________________ + +use std::e::{/* it's a comment! */ bar /* and another */}; +use std::f::{/* it's a comment! */ bar}; +use std::g::{bar /* and another */};