Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
54
third-party/vendor/toml_edit/tests/testsuite/stackoverflow.rs
vendored
Normal file
54
third-party/vendor/toml_edit/tests/testsuite/stackoverflow.rs
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#[test]
|
||||
#[cfg(not(feature = "unbounded"))]
|
||||
fn array_recursion_limit() {
|
||||
let depths = [(1, true), (20, true), (300, false)];
|
||||
for (depth, is_ok) in depths {
|
||||
let input = format!("x={}{}", &"[".repeat(depth), &"]".repeat(depth));
|
||||
let document = input.parse::<toml_edit::Document>();
|
||||
assert_eq!(document.is_ok(), is_ok, "depth: {}", depth);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "unbounded"))]
|
||||
fn inline_table_recursion_limit() {
|
||||
let depths = [(1, true), (20, true), (300, false)];
|
||||
for (depth, is_ok) in depths {
|
||||
let input = format!("x={}true{}", &"{ x = ".repeat(depth), &"}".repeat(depth));
|
||||
let document = input.parse::<toml_edit::Document>();
|
||||
assert_eq!(document.is_ok(), is_ok, "depth: {}", depth);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "unbounded"))]
|
||||
fn table_key_recursion_limit() {
|
||||
let depths = [(1, true), (20, true), (300, false)];
|
||||
for (depth, is_ok) in depths {
|
||||
let input = format!("[x{}]", &".x".repeat(depth));
|
||||
let document = input.parse::<toml_edit::Document>();
|
||||
assert_eq!(document.is_ok(), is_ok, "depth: {}", depth);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "unbounded"))]
|
||||
fn dotted_key_recursion_limit() {
|
||||
let depths = [(1, true), (20, true), (300, false)];
|
||||
for (depth, is_ok) in depths {
|
||||
let input = format!("x{} = true", &".x".repeat(depth));
|
||||
let document = input.parse::<toml_edit::Document>();
|
||||
assert_eq!(document.is_ok(), is_ok, "depth: {}", depth);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "unbounded"))]
|
||||
fn inline_dotted_key_recursion_limit() {
|
||||
let depths = [(1, true), (20, true), (300, false)];
|
||||
for (depth, is_ok) in depths {
|
||||
let input = format!("x = {{ x{} = true }}", &".x".repeat(depth));
|
||||
let document = input.parse::<toml_edit::Document>();
|
||||
assert_eq!(document.is_ok(), is_ok, "depth: {}", depth);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue