resolve test: the billion-laughs shape needs the early stop
This commit is contained in:
parent
14747c94f7
commit
c9c46a9a8b
1 changed files with 3 additions and 3 deletions
|
|
@ -326,14 +326,14 @@ fn cycles_and_depth_end_in_a_placeholder() {
|
|||
#[test]
|
||||
fn expansion_is_bounded() {
|
||||
big(|| {
|
||||
// A composition using the previous one twice, 17 levels: 2^17 nodes.
|
||||
// A composition using the previous one twice, 30 levels: 2^30 nodes, so only an early stop terminates.
|
||||
let mut chain = vec![composition("c0", &[], boxed("body", vec![]))];
|
||||
for n in 1..=17 {
|
||||
for n in 1..=30 {
|
||||
let below = format!("c{}", n - 1);
|
||||
let body = boxed("body", vec![use_of("l", &below, vec![]), use_of("r", &below, vec![])]);
|
||||
chain.push(composition(&format!("c{n}"), &[], body));
|
||||
}
|
||||
let resolution = run(&surface(boxed("root", vec![use_of("u", "c17", vec![])]), &[]), &state_with(&chain));
|
||||
let resolution = run(&surface(boxed("root", vec![use_of("u", "c30", vec![])]), &[]), &state_with(&chain));
|
||||
assert!(resolution.tree.is_none());
|
||||
assert!(resolution.diagnostics.iter().any(|found| found.code == Code::ExpansionLimit));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue