Skip to content

Commit 72c04fa

Browse files
committed
Add tests for issues which can be closed on the current master
This PR adds tests for #325, #1092, #1214, #1278, #1329 and #1427.
1 parent 8ac3fc3 commit 72c04fa

File tree

8 files changed

+72
-0
lines changed

8 files changed

+72
-0
lines changed

tests/source/closure.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,15 @@ impl Foo {
131131
})
132132
}
133133
}
134+
135+
fn issue1329() {
136+
aaaaaaaaaaaaaaaa.map(|x| {
137+
x += 1;
138+
x
139+
})
140+
.filter
141+
}
142+
143+
fn issue325() {
144+
let f = || unsafe { xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx };
145+
}

tests/source/issue-1278.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// rustfmt-fn_args_layout = "block"
2+
3+
#![feature(pub_restricted)]
4+
5+
mod inner_mode {
6+
pub(super) fn func_name(abc: i32) -> i32 {
7+
abc
8+
}
9+
}

tests/source/macros.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ fn main() {
8383
let json = json!({
8484
"foo": "bar",
8585
});
86+
87+
// #1092
88+
chain!(input, a:take!(max_size), || []);
8689
}
8790

8891
impl X {

tests/target/closure.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,17 @@ impl Foo {
150150
})
151151
}
152152
}
153+
154+
fn issue1329() {
155+
aaaaaaaaaaaaaaaa
156+
.map(|x| {
157+
x += 1;
158+
x
159+
})
160+
.filter
161+
}
162+
163+
fn issue325() {
164+
let f =
165+
|| unsafe { xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx };
166+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// rustfmt-fn_call_style: Block
2+
// rustfmt-max_width: 80
3+
// rustfmt-tab_spaces: 2
4+
5+
// #1427
6+
fn main() {
7+
exceptaions::config(move || {
8+
(
9+
NmiConfig {},
10+
HardFaultConfig {},
11+
SysTickConfig { gpio_sbsrr },
12+
)
13+
});
14+
}

tests/target/issue-1214.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*!
2+
# Example
3+
4+
```
5+
// Here goes some example
6+
```
7+
*/
8+
struct Item;

tests/target/issue-1278.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// rustfmt-fn_args_layout = "block"
2+
3+
#![feature(pub_restricted)]
4+
5+
mod inner_mode {
6+
pub(super) fn func_name(abc: i32) -> i32 {
7+
abc
8+
}
9+
}

tests/target/macros.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ fn main() {
8888
let json = json!({
8989
"foo": "bar",
9090
});
91+
92+
// #1092
93+
chain!(input, a:take!(max_size), || []);
9194
}
9295

9396
impl X {

0 commit comments

Comments
 (0)