tests: validate style_edition derivation
Adds a few tests that validate the various scenarios of precendence, overrides, and defaults to ensure the correct 'style_edition' value is selected even when other options like 'edition' and/or 'version' are included.
This commit is contained in:
parent
b6c89fc657
commit
e04e411852
@ -1,4 +1,4 @@
|
||||
// rustfmt-version: One
|
||||
// rustfmt-style_edition: 2015
|
||||
// rustfmt-error_on_line_overflow: false
|
||||
// rustfmt-indent_style: Block
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// rustfmt-version: Two
|
||||
// rustfmt-style_edition: 2024
|
||||
// rustfmt-error_on_line_overflow: false
|
||||
// rustfmt-indent_style: Block
|
||||
|
||||
|
9
tests/target/configs/version/mapped.rs
Normal file
9
tests/target/configs/version/mapped.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// rustfmt-version: Two
|
||||
fn main() {
|
||||
let [
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaa,
|
||||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
|
||||
cccccccccccccccccccccccccc,
|
||||
ddddddddddddddddddddddddd,
|
||||
] = panic!();
|
||||
}
|
10
tests/target/style_edition/default.rs
Normal file
10
tests/target/style_edition/default.rs
Normal file
@ -0,0 +1,10 @@
|
||||
fn build_sorted_static_get_entry_names(
|
||||
mut entries: Vec<(u8, &'static str)>,
|
||||
) -> (impl Fn(
|
||||
AlphabeticalTraversal,
|
||||
Box<dyn dirents_sink::Sink<AlphabeticalTraversal>>,
|
||||
) -> BoxFuture<'static, Result<Box<dyn dirents_sink::Sealed>, Status>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static) {
|
||||
}
|
14
tests/target/style_edition/follows_edition.rs
Normal file
14
tests/target/style_edition/follows_edition.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// rustfmt-edition: 2024
|
||||
|
||||
fn build_sorted_static_get_entry_names(
|
||||
mut entries: Vec<(u8, &'static str)>,
|
||||
) -> (
|
||||
impl Fn(
|
||||
AlphabeticalTraversal,
|
||||
Box<dyn dirents_sink::Sink<AlphabeticalTraversal>>,
|
||||
) -> BoxFuture<'static, Result<Box<dyn dirents_sink::Sealed>, Status>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static
|
||||
) {
|
||||
}
|
14
tests/target/style_edition/overrides_edition_when_set.rs
Normal file
14
tests/target/style_edition/overrides_edition_when_set.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// rustfmt-edition: 2018
|
||||
// rustfmt-style_edition: 2024
|
||||
fn build_sorted_static_get_entry_names(
|
||||
mut entries: Vec<(u8, &'static str)>,
|
||||
) -> (
|
||||
impl Fn(
|
||||
AlphabeticalTraversal,
|
||||
Box<dyn dirents_sink::Sink<AlphabeticalTraversal>>,
|
||||
) -> BoxFuture<'static, Result<Box<dyn dirents_sink::Sealed>, Status>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static
|
||||
) {
|
||||
}
|
Loading…
Reference in New Issue
Block a user