Skip to content

Commit

Permalink
try limits on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Tauber committed Aug 17, 2022
1 parent 528b66b commit 6f3787e
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions grammars/src/lib.rs
Expand Up @@ -52,13 +52,23 @@ mod tests {
"/resources/test/tomlfuzzsample2.toml"
));
const ERROR: &str = "call limit reached";
pest::set_call_limit(Some(2_000usize.try_into().unwrap()));
let s1 = toml::TomlParser::parse(toml::Rule::toml, sample1);
assert!(s1.is_err());
assert_eq!(s1.unwrap_err().variant.message(), ERROR);
let s2 = toml::TomlParser::parse(toml::Rule::toml, sample2);
assert!(s2.is_err());
assert_eq!(s2.unwrap_err().variant.message(), ERROR);
for limit in [100usize, 250, 500, 1000, 1500].iter() {
dbg!(limit);
pest::set_call_limit(Some((*limit).try_into().unwrap()));
let s1 = toml::TomlParser::parse(toml::Rule::toml, sample1);
assert!(s1.is_err());
assert_eq!(s1.unwrap_err().variant.message(), ERROR);
let s2 = toml::TomlParser::parse(toml::Rule::toml, sample2);
assert!(s2.is_err());
assert_eq!(s2.unwrap_err().variant.message(), ERROR);
}
// pest::set_call_limit(Some(2_000usize.try_into().unwrap()));
// let s1 = toml::TomlParser::parse(toml::Rule::toml, sample1);
// assert!(s1.is_err());
// assert_eq!(s1.unwrap_err().variant.message(), ERROR);
// let s2 = toml::TomlParser::parse(toml::Rule::toml, sample2);
// assert!(s2.is_err());
// assert_eq!(s2.unwrap_err().variant.message(), ERROR);
}

#[test]
Expand Down

0 comments on commit 6f3787e

Please sign in to comment.