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:
Caleb Cartwright 2024-07-19 18:23:16 -05:00 committed by Caleb Cartwright
parent b6c89fc657
commit e04e411852
6 changed files with 49 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015
// rustfmt-error_on_line_overflow: false
// rustfmt-indent_style: Block

View File

@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// rustfmt-error_on_line_overflow: false
// rustfmt-indent_style: Block

View File

@ -0,0 +1,9 @@
// rustfmt-version: Two
fn main() {
let [
aaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
cccccccccccccccccccccccccc,
ddddddddddddddddddddddddd,
] = panic!();
}

View 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) {
}

View 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
) {
}

View 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
) {
}