Skip to content

Commit

Permalink
Fix cmd_line tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo committed Oct 1, 2023
1 parent a2f0f39 commit d6da46e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/cmd_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ mod tests {
#[test]
#[serial]
fn test_files_to_open_with_flag() {
let args: Vec<String> = vec!["neovide", "./foo.txt", "./bar.md", "--geometry=42x24"]
let args: Vec<String> = vec!["neovide", "./foo.txt", "./bar.md", "--grid=42x24"]
.iter()
.map(|s| s.to_string())
.collect();
Expand All @@ -236,29 +236,29 @@ mod tests {
);

assert_eq!(
SETTINGS.get::<CmdLineSettings>().geometry,
Some(Dimensions {
SETTINGS.get::<CmdLineSettings>().geometry.grid,
Some(Some(Dimensions {
width: 42,
height: 24
}),
})),
);
}

#[test]
#[serial]
fn test_geometry() {
let args: Vec<String> = vec!["neovide", "--geometry=42x24"]
fn test_grid() {
let args: Vec<String> = vec!["neovide", "--grid=42x24"]
.iter()
.map(|s| s.to_string())
.collect();

handle_command_line_arguments(args).expect("Could not parse arguments");
assert_eq!(
SETTINGS.get::<CmdLineSettings>().geometry,
Some(Dimensions {
SETTINGS.get::<CmdLineSettings>().geometry.grid,
Some(Some(Dimensions {
width: 42,
height: 24
}),
})),
);
}

Expand All @@ -272,7 +272,7 @@ mod tests {

handle_command_line_arguments(args).expect("Could not parse arguments");
assert_eq!(
SETTINGS.get::<CmdLineSettings>().size,
SETTINGS.get::<CmdLineSettings>().geometry.size,
Some(Dimensions {
width: 420,
height: 240,
Expand Down

0 comments on commit d6da46e

Please sign in to comment.