about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authoramab8901 <83634595+amab8901@users.noreply.github.com>2023-01-28 22:18:52 +0100
committerGitHub <noreply@github.com>2023-01-28 15:18:52 -0600
commitbcfc57ec8a8fb1120b9b447df21cd07aac6c228d (patch)
tree1bbbdfa0d93a357ec675d84096ccc4fd8d4a755d /tests
parent567bd977230f3fe64781e9946b9f692919d30d38 (diff)
downloadrust-bcfc57ec8a8fb1120b9b447df21cd07aac6c228d.tar.gz
rust-bcfc57ec8a8fb1120b9b447df21cd07aac6c228d.zip
added tests (#5619)
Diffstat (limited to 'tests')
-rw-r--r--tests/source/issue-5586.rs164
-rw-r--r--tests/target/issue-5586.rs177
2 files changed, 341 insertions, 0 deletions
diff --git a/tests/source/issue-5586.rs b/tests/source/issue-5586.rs
new file mode 100644
index 00000000000..9cf6c1d58dd
--- /dev/null
+++ b/tests/source/issue-5586.rs
@@ -0,0 +1,164 @@
+// rustfmt-version: Two
+fn main() {
+    // sample 1
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident =
+                            if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
+                                self.node_id_as_ident(node_id, false)
+                            } else {
+                                // Entire subgraph is pull (except for a single send/push handoff output).
+                                assert_eq!(
+    1,
+    send_ports.len(),
+    "If entire subgraph is pull, should have only one handoff output."
+);
+                                send_ports[0].clone()
+                            };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 2
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 3
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident =
+                            if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
+                                self.node_id_as_ident(node_id, false)
+                            } else {
+                                // Entire subgraph is pull (except for a single send/push handoff output).
+                                assert_eq!(
+                    1,
+                    send_ports.len(),
+                    "If entire subgraph is pull, should have only one handoff output."
+                );
+                                send_ports[0].clone()
+                            };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 4
+    {{{{{
+        let push_ident =
+            if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
+                self.node_id_as_ident(node_id, false)
+            } else {
+                // Entire subgraph is pull (except for a single send/push handoff output).
+                assert_eq!(
+                    1,
+                    send_ports.len(),
+                    "If entire subgraph is pull, should have only one handoff output."
+                );
+                send_ports[0].clone()
+            };
+    }}}}}
+
+    // sample 5
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident =
+                            if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
+                                self.node_id_as_ident(node_id, false)
+                            } else {
+                                // Entire subgraph is pull (except for a single send/push handoff output).
+                                assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                                send_ports[0].clone()
+                            };
+                    }
+                }
+            }
+        }
+    }
+    
+    // sample 6
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 7
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident =
+                            if let Some(&node_id) = subgraph_nodes.get(pull_to_push_idx) {
+                                self.node_id_as_ident(node_id, false)
+                            } else {
+                                // Entire subgraph is pull (except for a single send/push handoff output).
+                                assert_eq!(
+                                    1,
+                                    send_ports.len(),
+                                    "If entire subgraph is pull, should have only one handoff output."
+                                );
+                                send_ports[0].clone()
+                            };
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/tests/target/issue-5586.rs b/tests/target/issue-5586.rs
new file mode 100644
index 00000000000..7033ae975b3
--- /dev/null
+++ b/tests/target/issue-5586.rs
@@ -0,0 +1,177 @@
+// rustfmt-version: Two
+fn main() {
+    // sample 1
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 2
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 3
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 4
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 5
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 6
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+
+    // sample 7
+    {
+        {
+            {
+                {
+                    {
+                        let push_ident = if let Some(&node_id) =
+                            subgraph_nodes.get(pull_to_push_idx)
+                        {
+                            self.node_id_as_ident(node_id, false)
+                        } else {
+                            // Entire subgraph is pull (except for a single send/push handoff output).
+                            assert_eq!(
+                                1,
+                                send_ports.len(),
+                                "If entire subgraph is pull, should have only one handoff output."
+                            );
+                            send_ports[0].clone()
+                        };
+                    }
+                }
+            }
+        }
+    }
+}