Skip to content

Commit bcfc57e

Browse files
authored
added tests (#5619)
1 parent 567bd97 commit bcfc57e

File tree

2 files changed

+341
-0
lines changed

2 files changed

+341
-0
lines changed

Diff for: tests/source/issue-5586.rs

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
// rustfmt-version: Two
2+
fn main() {
3+
// sample 1
4+
{
5+
{
6+
{
7+
{
8+
{
9+
let push_ident =
10+
if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
11+
self.node_id_as_ident(node_id, false)
12+
} else {
13+
// Entire subgraph is pull (except for a single send/push handoff output).
14+
assert_eq!(
15+
1,
16+
send_ports.len(),
17+
"If entire subgraph is pull, should have only one handoff output."
18+
);
19+
send_ports[0].clone()
20+
};
21+
}
22+
}
23+
}
24+
}
25+
}
26+
27+
// sample 2
28+
{
29+
{
30+
{
31+
{
32+
{
33+
let push_ident = if let Some(&node_id) =
34+
subgraph_nodes.get(pull_to_push_idx)
35+
{
36+
self.node_id_as_ident(node_id, false)
37+
} else {
38+
// Entire subgraph is pull (except for a single send/push handoff output).
39+
assert_eq!(
40+
1,
41+
send_ports.len(),
42+
"If entire subgraph is pull, should have only one handoff output."
43+
);
44+
send_ports[0].clone()
45+
};
46+
}
47+
}
48+
}
49+
}
50+
}
51+
52+
// sample 3
53+
{
54+
{
55+
{
56+
{
57+
{
58+
let push_ident =
59+
if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
60+
self.node_id_as_ident(node_id, false)
61+
} else {
62+
// Entire subgraph is pull (except for a single send/push handoff output).
63+
assert_eq!(
64+
1,
65+
send_ports.len(),
66+
"If entire subgraph is pull, should have only one handoff output."
67+
);
68+
send_ports[0].clone()
69+
};
70+
}
71+
}
72+
}
73+
}
74+
}
75+
76+
// sample 4
77+
{{{{{
78+
let push_ident =
79+
if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
80+
self.node_id_as_ident(node_id, false)
81+
} else {
82+
// Entire subgraph is pull (except for a single send/push handoff output).
83+
assert_eq!(
84+
1,
85+
send_ports.len(),
86+
"If entire subgraph is pull, should have only one handoff output."
87+
);
88+
send_ports[0].clone()
89+
};
90+
}}}}}
91+
92+
// sample 5
93+
{
94+
{
95+
{
96+
{
97+
{
98+
let push_ident =
99+
if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
100+
self.node_id_as_ident(node_id, false)
101+
} else {
102+
// Entire subgraph is pull (except for a single send/push handoff output).
103+
assert_eq!(
104+
1,
105+
send_ports.len(),
106+
"If entire subgraph is pull, should have only one handoff output."
107+
);
108+
send_ports[0].clone()
109+
};
110+
}
111+
}
112+
}
113+
}
114+
}
115+
116+
// sample 6
117+
{
118+
{
119+
{
120+
{
121+
{
122+
let push_ident = if let Some(&node_id) =
123+
subgraph_nodes.get(pull_to_push_idx)
124+
{
125+
self.node_id_as_ident(node_id, false)
126+
} else {
127+
// Entire subgraph is pull (except for a single send/push handoff output).
128+
assert_eq!(
129+
1,
130+
send_ports.len(),
131+
"If entire subgraph is pull, should have only one handoff output."
132+
);
133+
send_ports[0].clone()
134+
};
135+
}
136+
}
137+
}
138+
}
139+
}
140+
141+
// sample 7
142+
{
143+
{
144+
{
145+
{
146+
{
147+
let push_ident =
148+
if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
149+
self.node_id_as_ident(node_id, false)
150+
} else {
151+
// Entire subgraph is pull (except for a single send/push handoff output).
152+
assert_eq!(
153+
1,
154+
send_ports.len(),
155+
"If entire subgraph is pull, should have only one handoff output."
156+
);
157+
send_ports[0].clone()
158+
};
159+
}
160+
}
161+
}
162+
}
163+
}
164+
}

Diff for: tests/target/issue-5586.rs

+177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
// rustfmt-version: Two
2+
fn main() {
3+
// sample 1
4+
{
5+
{
6+
{
7+
{
8+
{
9+
let push_ident = if let Some(&node_id) =
10+
subgraph_nodes.get(pull_to_push_idx)
11+
{
12+
self.node_id_as_ident(node_id, false)
13+
} else {
14+
// Entire subgraph is pull (except for a single send/push handoff output).
15+
assert_eq!(
16+
1,
17+
send_ports.len(),
18+
"If entire subgraph is pull, should have only one handoff output."
19+
);
20+
send_ports[0].clone()
21+
};
22+
}
23+
}
24+
}
25+
}
26+
}
27+
28+
// sample 2
29+
{
30+
{
31+
{
32+
{
33+
{
34+
let push_ident = if let Some(&node_id) =
35+
subgraph_nodes.get(pull_to_push_idx)
36+
{
37+
self.node_id_as_ident(node_id, false)
38+
} else {
39+
// Entire subgraph is pull (except for a single send/push handoff output).
40+
assert_eq!(
41+
1,
42+
send_ports.len(),
43+
"If entire subgraph is pull, should have only one handoff output."
44+
);
45+
send_ports[0].clone()
46+
};
47+
}
48+
}
49+
}
50+
}
51+
}
52+
53+
// sample 3
54+
{
55+
{
56+
{
57+
{
58+
{
59+
let push_ident = if let Some(&node_id) =
60+
subgraph_nodes.get(pull_to_push_idx)
61+
{
62+
self.node_id_as_ident(node_id, false)
63+
} else {
64+
// Entire subgraph is pull (except for a single send/push handoff output).
65+
assert_eq!(
66+
1,
67+
send_ports.len(),
68+
"If entire subgraph is pull, should have only one handoff output."
69+
);
70+
send_ports[0].clone()
71+
};
72+
}
73+
}
74+
}
75+
}
76+
}
77+
78+
// sample 4
79+
{
80+
{
81+
{
82+
{
83+
{
84+
let push_ident = if let Some(&node_id) =
85+
subgraph_nodes.get(pull_to_push_idx)
86+
{
87+
self.node_id_as_ident(node_id, false)
88+
} else {
89+
// Entire subgraph is pull (except for a single send/push handoff output).
90+
assert_eq!(
91+
1,
92+
send_ports.len(),
93+
"If entire subgraph is pull, should have only one handoff output."
94+
);
95+
send_ports[0].clone()
96+
};
97+
}
98+
}
99+
}
100+
}
101+
}
102+
103+
// sample 5
104+
{
105+
{
106+
{
107+
{
108+
{
109+
let push_ident = if let Some(&node_id) =
110+
subgraph_nodes.get(pull_to_push_idx)
111+
{
112+
self.node_id_as_ident(node_id, false)
113+
} else {
114+
// Entire subgraph is pull (except for a single send/push handoff output).
115+
assert_eq!(
116+
1,
117+
send_ports.len(),
118+
"If entire subgraph is pull, should have only one handoff output."
119+
);
120+
send_ports[0].clone()
121+
};
122+
}
123+
}
124+
}
125+
}
126+
}
127+
128+
// sample 6
129+
{
130+
{
131+
{
132+
{
133+
{
134+
let push_ident = if let Some(&node_id) =
135+
subgraph_nodes.get(pull_to_push_idx)
136+
{
137+
self.node_id_as_ident(node_id, false)
138+
} else {
139+
// Entire subgraph is pull (except for a single send/push handoff output).
140+
assert_eq!(
141+
1,
142+
send_ports.len(),
143+
"If entire subgraph is pull, should have only one handoff output."
144+
);
145+
send_ports[0].clone()
146+
};
147+
}
148+
}
149+
}
150+
}
151+
}
152+
153+
// sample 7
154+
{
155+
{
156+
{
157+
{
158+
{
159+
let push_ident = if let Some(&node_id) =
160+
subgraph_nodes.get(pull_to_push_idx)
161+
{
162+
self.node_id_as_ident(node_id, false)
163+
} else {
164+
// Entire subgraph is pull (except for a single send/push handoff output).
165+
assert_eq!(
166+
1,
167+
send_ports.len(),
168+
"If entire subgraph is pull, should have only one handoff output."
169+
);
170+
send_ports[0].clone()
171+
};
172+
}
173+
}
174+
}
175+
}
176+
}
177+
}

0 commit comments

Comments
 (0)