Skip to content

Commit

Permalink
Add tests for ExternalCrate grouping interacting with other options
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Mar 29, 2023
1 parent b036bb4 commit 6224160
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/source/configs/group_imports/ExternalCrate-merge_imports.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// rustfmt-group_imports: ExternalCrate
// rustfmt-imports_granularity: Crate
use chrono::Utc;
use super::update::convert_publish_payload;

use juniper::{FieldError, FieldResult};
use uuid::Uuid;
use alloc::alloc::Layout;

use std::sync::Arc;
use alloc::vec::Vec;

use broker::database::PooledConnection;

use super::schema::{Context, Payload};
use core::f32;
use crate::models::Event;
7 changes: 7 additions & 0 deletions tests/source/configs/group_imports/ExternalCrate-nested.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// rustfmt-group_imports: ExternalCrate
mod test {
use crate::foo::bar;
use std::path;
use crate::foo::bar2;
use uuid::Uuid;
}
17 changes: 17 additions & 0 deletions tests/source/configs/group_imports/ExternalCrate-no_reorder.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// rustfmt-group_imports: ExternalCrate
// rustfmt-reorder_imports: false

use chrono::Utc;
use super::update::convert_publish_payload;

use juniper::{FieldError, FieldResult};
use uuid::Uuid;
use alloc::alloc::Layout;

use std::sync::Arc;

use broker::database::PooledConnection;

use super::schema::{Context, Payload};
use core::f32;
use crate::models::Event;
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// rustfmt-group_imports: ExternalCrate
use chrono::Utc;
use super::update::convert_publish_payload;





use juniper::{FieldError, FieldResult};

use uuid::Uuid;
use alloc::alloc::Layout;

extern crate uuid;





use std::sync::Arc;


use broker::database::PooledConnection;

use super::schema::{Context, Payload};
use core::f32;
use crate::models::Event;
15 changes: 15 additions & 0 deletions tests/target/configs/group_imports/ExternalCrate-merge_imports.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-group_imports: ExternalCrate
// rustfmt-imports_granularity: Crate
use alloc::{alloc::Layout, vec::Vec};
use broker::database::PooledConnection;
use chrono::Utc;
use core::f32;
use juniper::{FieldError, FieldResult};
use std::sync::Arc;
use uuid::Uuid;

use super::{
schema::{Context, Payload},
update::convert_publish_payload,
};
use crate::models::Event;
8 changes: 8 additions & 0 deletions tests/target/configs/group_imports/ExternalCrate-nested.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// rustfmt-group_imports: ExternalCrate
mod test {
use std::path;
use uuid::Uuid;

use crate::foo::bar;
use crate::foo::bar2;
}
14 changes: 14 additions & 0 deletions tests/target/configs/group_imports/ExternalCrate-no_reorder.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// rustfmt-group_imports: ExternalCrate
// rustfmt-reorder_imports: false

use chrono::Utc;
use juniper::{FieldError, FieldResult};
use uuid::Uuid;
use alloc::alloc::Layout;
use std::sync::Arc;
use broker::database::PooledConnection;
use core::f32;

use super::update::convert_publish_payload;
use super::schema::{Context, Payload};
use crate::models::Event;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// rustfmt-group_imports: ExternalCrate
use alloc::alloc::Layout;
use chrono::Utc;
use juniper::{FieldError, FieldResult};
use uuid::Uuid;

use super::update::convert_publish_payload;

extern crate uuid;

use broker::database::PooledConnection;
use core::f32;
use std::sync::Arc;

use super::schema::{Context, Payload};
use crate::models::Event;

0 comments on commit 6224160

Please sign in to comment.