Skip to content

Commit

Permalink
bump rust version
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Mar 15, 2024
1 parent 668acc3 commit 0cd890c
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/cli/alias/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ mod tests {
#[test]
fn test_alias_get_plugin_unknown() {
let err = assert_cli_err!("alias", "get", "unknown", "unknown");
assert_display_snapshot!(err, @"Unknown plugin: unknown");
assert_snapshot!(err, @"Unknown plugin: unknown");
}

#[test]
fn test_alias_get_alias_unknown() {
let err = assert_cli_err!("alias", "get", "tiny", "unknown");
assert_display_snapshot!(err, @"Unknown alias: unknown");
assert_snapshot!(err, @"Unknown alias: unknown");
}
}
2 changes: 1 addition & 1 deletion src/cli/deactivate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ mod tests {
fn test_deactivate() {
let _config = Config::try_get().unwrap(); // hack: prevents error parsing __MISE_DIFF
let err = assert_cli_err!("deactivate");
assert_display_snapshot!(err);
assert_snapshot!(err);
env::set_var("__MISE_DIFF", "");
env::set_var("MISE_SHELL", "zsh");
assert_cli_snapshot!("deactivate");
Expand Down
2 changes: 1 addition & 1 deletion src/cli/direnv/envrc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ mod tests {
.filter(|l| !l.starts_with("export REMOTE_"))
.collect::<Vec<_>>()
.join("\n");
assert_display_snapshot!(envrc);
assert_snapshot!(envrc);
}
}
2 changes: 1 addition & 1 deletion src/cli/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ mod tests {
#[test]
fn test_exec_fail() {
let err = assert_cli_err!("exec", "--", "exit", "1");
assert_display_snapshot!(err);
assert_snapshot!(err);
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/cli/latest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ mod tests {
#[test]
fn test_latest_system() {
let err = assert_cli_err!("latest", "dummy@system");
assert_display_snapshot!(err);
assert_snapshot!(err);
}

#[test]
Expand All @@ -90,7 +90,7 @@ mod tests {
#[test]
fn test_latest_missing_plugin() {
let stdout = assert_cli_err!("latest", "invalid_plugin");
assert_display_snapshot!(stdout);
assert_snapshot!(stdout);
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/cli/plugins/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ mod tests {
#[test]
fn test_plugin_install_invalid_url() {
let err = assert_cli_err!("plugin", "add", "tiny*");
assert_display_snapshot!(err, @"No repository found for plugin tiny*");
assert_snapshot!(err, @"No repository found for plugin tiny*");
}

#[test]
fn test_plugin_install_core_plugin() {
let err = assert_cli_err!("plugin", "add", "node");
assert_display_snapshot!(err, @"node is a core plugin and does not need to be installed");
assert_snapshot!(err, @"node is a core plugin and does not need to be installed");
}
}
2 changes: 1 addition & 1 deletion src/cli/settings/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ mod tests {
#[test]
fn test_settings_get_unknown() {
let err = assert_cli_err!("settings", "get", "unknown");
assert_display_snapshot!(err, @"Unknown setting: unknown");
assert_snapshot!(err, @"Unknown setting: unknown");
}
}
2 changes: 1 addition & 1 deletion src/cli/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ mod tests {
#[test]
fn test_shell() {
let err = assert_cli_err!("shell", "[email protected]");
assert_display_snapshot!(err);
assert_snapshot!(err);
env::set_var("__MISE_DIFF", "");
env::set_var("MISE_SHELL", "zsh");
assert_cli_snapshot!("shell", "[email protected]");
Expand Down
2 changes: 1 addition & 1 deletion src/cli/where.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ mod tests {
#[test]
fn test_where_not_found() {
let err = assert_cli_err!("where", "tiny@1111");
assert_display_snapshot!(err, @"tiny@1111 not installed");
assert_snapshot!(err, @"tiny@1111 not installed");
}
}
10 changes: 5 additions & 5 deletions src/config/config_file/mise_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ mod tests {
let cf: Box<dyn ConfigFile> = Box::new(cf);
with_settings!({
assert_snapshot!(cf.dump().unwrap());
assert_display_snapshot!(cf);
assert_snapshot!(cf);
assert_debug_snapshot!(cf);
});
}
Expand Down Expand Up @@ -1029,7 +1029,7 @@ mod tests {

assert_debug_snapshot!(cf.alias);
let cf: Box<dyn ConfigFile> = Box::new(cf);
assert_display_snapshot!(cf);
assert_snapshot!(cf);
file::remove_file(&p).unwrap();
}

Expand Down Expand Up @@ -1057,7 +1057,7 @@ mod tests {
assert_debug_snapshot!(cf.alias);
let cf: Box<dyn ConfigFile> = Box::new(cf);
assert_snapshot!(cf.dump().unwrap());
assert_display_snapshot!(cf);
assert_snapshot!(cf);
assert_debug_snapshot!(cf);
file::remove_file(&p).unwrap();
}
Expand All @@ -1081,7 +1081,7 @@ mod tests {
assert_debug_snapshot!(cf.to_toolset().unwrap());
let cf: Box<dyn ConfigFile> = Box::new(cf);
assert_snapshot!(cf.dump().unwrap());
assert_display_snapshot!(cf);
assert_snapshot!(cf);
assert_debug_snapshot!(cf);
}

Expand All @@ -1102,7 +1102,7 @@ mod tests {
assert_debug_snapshot!(cf.to_toolset().unwrap());
let cf: Box<dyn ConfigFile> = Box::new(cf);
assert_snapshot!(cf.dump().unwrap());
assert_display_snapshot!(cf);
assert_snapshot!(cf);
assert_debug_snapshot!(cf);
}

Expand Down
4 changes: 2 additions & 2 deletions src/config/config_file/tool_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ pub(crate) mod tests {
tv.path,
env::current_dir().unwrap().join(".test-tool-versions")
);
assert_display_snapshot!(tv, @"ToolVersions(~/cwd/.test-tool-versions): tiny@3");
assert_snapshot!(tv, @"ToolVersions(~/cwd/.test-tool-versions): tiny@3");
}

#[test]
Expand Down Expand Up @@ -278,6 +278,6 @@ pub(crate) mod tests {
"};
let path = env::current_dir().unwrap().join(".test-tool-versions");
let tv = ToolVersions::parse_str(orig, path).unwrap();
assert_display_snapshot!(tv.to_toolset().unwrap(), @"[email protected] [email protected]");
assert_snapshot!(tv.to_toolset().unwrap(), @"[email protected] [email protected]");
}
}
14 changes: 7 additions & 7 deletions src/direnv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ mod tests {
fn test_parse() {
let input = r#"eJys0c1yojAAwPF3ybmWaLB-zPSAGCqIQCGgeGGIELDlM2BEOr77zs7szr7AXv-H3-X_Axqw_gGabYM1qPk1A88XUP1OW93FVhBtdReswURq-FXEfSqJmEusLpKUdxLspALRJY1Yt2Bifk8aLhf5iiZIhhDCjEtE6svmteGuSJVHAV7-qppuYrAG_0WVXtNK8Ms__KgQdYc9sAapMXRj1-9XW8VX7A16UA4NPIs9xCK5WO51XnvfwWBT1R9N7zIcHvvJbZF5g8pk0V2c5CboIw8_NjOUWDK5qcxIcaFrp3anhwdr5FeKJmfd9stgqvuVZqcXsXHYJ-kSGWpoxyZLzf0a0LUcMgv17exenXXunfOTZZfybiVmb9OAhjDtHEcOk0lrRWG84OrRobW6IgGGZqwelglTq8UmJrbP9p0x9pTW5t3L21P1mZfL7_pMtIW599v-Cx_dmzEdCcZ1TAzkz7dvfO4QAefO6Y4VxYmijzgP_Oz9Hbz8uU5jDp7PXwEAAP__wB6qKg=="#;
let diff = DirenvDiff::parse(input).unwrap();
assert_display_snapshot!(diff);
assert_snapshot!(diff);
}

#[test]
Expand All @@ -127,9 +127,9 @@ mod tests {
new: HashMap::from([("c".to_string(), "d".to_string())]),
};
let output = diff.dump().unwrap();
assert_display_snapshot!(&output);
assert_snapshot!(&output);
let diff = DirenvDiff::parse(&output).unwrap();
assert_display_snapshot!(diff);
assert_snapshot!(diff);
}

#[test]
Expand All @@ -140,8 +140,8 @@ mod tests {
};
let path = PathBuf::from("/tmp");
diff.add_path_to_old_and_new(&path).unwrap();
assert_display_snapshot!(diff.old.get("PATH").unwrap());
assert_display_snapshot!(diff.new.get("PATH").unwrap());
assert_snapshot!(diff.old.get("PATH").unwrap());
assert_snapshot!(diff.new.get("PATH").unwrap());
}

#[test]
Expand All @@ -152,7 +152,7 @@ mod tests {
};
let path = PathBuf::from("/tmp");
diff.add_path_to_old_and_new(&path).unwrap();
assert_display_snapshot!(diff.old.get("PATH").unwrap());
assert_display_snapshot!(diff.new.get("PATH").unwrap());
assert_snapshot!(diff.old.get("PATH").unwrap());
assert_snapshot!(diff.new.get("PATH").unwrap());
}
}
2 changes: 1 addition & 1 deletion src/toolset/tool_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl ToolVersion {
ToolVersion {
forge: tool.fa().clone(),
version: regex!(r"^v(\d+(\.\d+)*([+-.].+)?)$")
.replace(&version, |caps: &Captures| format!("{}", &caps[1]))
.replace(&version, |caps: &Captures| caps[1].to_string())
.to_string(),
request,
opts,
Expand Down

0 comments on commit 0cd890c

Please sign in to comment.