Skip to content

Commit

Permalink
added tests (#5619)
Browse files Browse the repository at this point in the history
  • Loading branch information
amab8901 authored Jan 28, 2023
1 parent 567bd97 commit bcfc57e
Show file tree
Hide file tree
Showing 2 changed files with 341 additions and 0 deletions.
164 changes: 164 additions & 0 deletions tests/source/issue-5586.rs
Original file line number Diff line number Diff line change
@@ -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()
};
}
}
}
}
}
}
177 changes: 177 additions & 0 deletions tests/target/issue-5586.rs
Original file line number Diff line number Diff line change
@@ -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()
};
}
}
}
}
}
}

0 comments on commit bcfc57e

Please sign in to comment.