diff options
| author | cassaundra <cass@cassaundra.io> | 2022-01-14 17:25:46 -0800 |
|---|---|---|
| committer | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2022-03-06 11:23:50 -0600 |
| commit | ab9f2a8ac78a66ae1fb0f92ae5a32ce5c0db0d8d (patch) | |
| tree | dd9e3cce941f434ecf914c0a482d401e030d4053 | |
| parent | ee130515e3788d886cdf18442871936a99c134b6 (diff) | |
| download | rust-ab9f2a8ac78a66ae1fb0f92ae5a32ce5c0db0d8d.tar.gz rust-ab9f2a8ac78a66ae1fb0f92ae5a32ce5c0db0d8d.zip | |
Add more tests for struct_field_align_threshold and trailing_comma
| -rw-r--r-- | tests/source/issue-4791/buggy.rs (renamed from tests/source/issue_4791.rs) | 0 | ||||
| -rw-r--r-- | tests/source/issue-4791/trailing_comma.rs | 14 | ||||
| -rw-r--r-- | tests/target/issue-4791/buggy.rs (renamed from tests/target/issue_4791.rs) | 0 | ||||
| -rw-r--r-- | tests/target/issue-4791/no_trailing_comma.rs | 8 | ||||
| -rw-r--r-- | tests/target/issue-4791/trailing_comma.rs | 14 |
5 files changed, 36 insertions, 0 deletions
diff --git a/tests/source/issue_4791.rs b/tests/source/issue-4791/buggy.rs index 4760022eeaf..4760022eeaf 100644 --- a/tests/source/issue_4791.rs +++ b/tests/source/issue-4791/buggy.rs diff --git a/tests/source/issue-4791/trailing_comma.rs b/tests/source/issue-4791/trailing_comma.rs new file mode 100644 index 00000000000..c56c70faeae --- /dev/null +++ b/tests/source/issue-4791/trailing_comma.rs @@ -0,0 +1,14 @@ +// rustfmt-struct_field_align_threshold: 30 +// rustfmt-trailing_comma: Always + +struct Foo { + group_a: u8, + + group_b: u8 +} + +struct Bar { + group_a: u8, + + group_b: u8, +} diff --git a/tests/target/issue_4791.rs b/tests/target/issue-4791/buggy.rs index fff58be99a5..fff58be99a5 100644 --- a/tests/target/issue_4791.rs +++ b/tests/target/issue-4791/buggy.rs diff --git a/tests/target/issue-4791/no_trailing_comma.rs b/tests/target/issue-4791/no_trailing_comma.rs new file mode 100644 index 00000000000..4a37163969a --- /dev/null +++ b/tests/target/issue-4791/no_trailing_comma.rs @@ -0,0 +1,8 @@ +// rustfmt-struct_field_align_threshold: 0 +// rustfmt-trailing_comma: Never + +pub struct Baz { + group_a: u8, + + group_b: u8 +} diff --git a/tests/target/issue-4791/trailing_comma.rs b/tests/target/issue-4791/trailing_comma.rs new file mode 100644 index 00000000000..29a224b3f6d --- /dev/null +++ b/tests/target/issue-4791/trailing_comma.rs @@ -0,0 +1,14 @@ +// rustfmt-struct_field_align_threshold: 30 +// rustfmt-trailing_comma: Always + +struct Foo { + group_a: u8, + + group_b: u8, +} + +struct Bar { + group_a: u8, + + group_b: u8, +} |
