Upgrade RustPython (#4747)

This commit is contained in:
Micha Reiser
2023-05-31 10:26:35 +02:00
committed by GitHub
parent 06bcb85f81
commit 6c1ff6a85f
17 changed files with 104 additions and 93 deletions

View File

@@ -1456,7 +1456,8 @@ impl<'a> Generator<'a> {
#[cfg(test)]
mod tests {
use rustpython_parser as parser;
use rustpython_ast::Suite;
use rustpython_parser::Parse;
use crate::newlines::LineEnding;
use crate::source_code::stylist::{Indentation, Quote};
@@ -1466,7 +1467,7 @@ mod tests {
let indentation = Indentation::default();
let quote = Quote::default();
let line_ending = LineEnding::default();
let program = parser::parse_program(contents, "<filename>").unwrap();
let program = Suite::parse(contents, "<filename>").unwrap();
let stmt = program.first().unwrap();
let mut generator = Generator::new(&indentation, quote, line_ending);
generator.unparse_stmt(stmt);
@@ -1479,7 +1480,7 @@ mod tests {
line_ending: LineEnding,
contents: &str,
) -> String {
let program = parser::parse_program(contents, "<filename>").unwrap();
let program = Suite::parse(contents, "<filename>").unwrap();
let stmt = program.first().unwrap();
let mut generator = Generator::new(indentation, quote, line_ending);
generator.unparse_stmt(stmt);