Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lexa-diky committed Jul 10, 2024
1 parent 24eeaec commit d77e55d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ pub(crate) struct Cli {
}

#[derive(Copy, Clone, Debug)]
struct CliCompilerArguments {
pub(crate) struct CliCompilerArguments {
safe_mode: bool,
}

impl CliCompilerArguments {
pub(crate) fn new(safe_mode: bool) -> CliCompilerArguments {
CliCompilerArguments {
safe_mode
}
}
}

impl Cli {
pub(crate) fn run() {
let build_started = Instant::now();
Expand All @@ -80,9 +88,7 @@ impl Cli {
}

fn cli_compiler_arguments(&self) -> CliCompilerArguments {
CliCompilerArguments {
safe_mode: self.safe
}
CliCompilerArguments::new(self.safe)
}

fn log_debug_interface_arguments(&self) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod test {
($case:ident) => {
#[test]
fn $case() {
HexoLogger::set_level(LogLevel::None);
HexoLogger::set_level(&LogLevel::None);
let case_name = stringify!($case);

let input_file_path = format!("samples/{case_name}/input.hexo");
Expand All @@ -36,7 +36,7 @@ mod test {
Cli::build(
input_file_path,
Some(actual_file_path.to_string_lossy().to_string()),
,
crate::cli::CliCompilerArguments::new(false),
).unwrap();

let mut expected_file = File::open(expected_file_path).unwrap();
Expand Down

0 comments on commit d77e55d

Please sign in to comment.