// Parse a string of code that is meant to fail
Parse a string of code that is meant to fail
Parse a string of code that is meant to fail
pub fn parse_str_fail(contents: impl Into<String>) {
  // Parse the code
  let res = Parser::parse(contents.into().as_bytes());
  // If the code parsed without error
  if let Ok(parsed_content) = res {
    // There is a problem with the parser
    // Output the result in an error (failing the test)
    panic!("{:?}", parsed_content);
  }
}
pub fn parse_str_fail ( contents : impl Into < String > ) { // Parse the code let res = Parser :: parse ( contents . into ( ) . as_bytes ( ) ) ; // If the code parsed without error if let Ok ( parsed_content ) = res { // There is a problem with the parser // Output the result in an error (failing the test) panic ! ( " " parsed_content ) ; } }
Parse a string of code that is meant to fail
Parse a string of code that is meant to fail
contents
impl Into<String>