diff --git a/.idea/.gitignore b/.idea/.gitignore index 13566b81b..a9d7db9c0 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,5 @@ # Datasource local storage ignored files /dataSources/ /dataSources.local.xml +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/src/cli/alias/get.rs b/src/cli/alias/get.rs index 0a244761a..ef2768ec3 100644 --- a/src/cli/alias/get.rs +++ b/src/cli/alias/get.rs @@ -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"); } } diff --git a/src/cli/deactivate.rs b/src/cli/deactivate.rs index 9944b69e5..27b5c2312 100644 --- a/src/cli/deactivate.rs +++ b/src/cli/deactivate.rs @@ -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"); diff --git a/src/cli/direnv/envrc.rs b/src/cli/direnv/envrc.rs index f433bb713..61b5eecae 100644 --- a/src/cli/direnv/envrc.rs +++ b/src/cli/direnv/envrc.rs @@ -69,6 +69,6 @@ mod tests { .filter(|l| !l.starts_with("export REMOTE_")) .collect::>() .join("\n"); - assert_display_snapshot!(envrc); + assert_snapshot!(envrc); } } diff --git a/src/cli/exec.rs b/src/cli/exec.rs index d5fd3ca52..af319bcda 100644 --- a/src/cli/exec.rs +++ b/src/cli/exec.rs @@ -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] diff --git a/src/cli/latest.rs b/src/cli/latest.rs index 3a7abff75..9578089cc 100644 --- a/src/cli/latest.rs +++ b/src/cli/latest.rs @@ -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] @@ -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] diff --git a/src/cli/plugins/install.rs b/src/cli/plugins/install.rs index 474ffcab0..6d8a8c659 100644 --- a/src/cli/plugins/install.rs +++ b/src/cli/plugins/install.rs @@ -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"); } } diff --git a/src/cli/settings/get.rs b/src/cli/settings/get.rs index 3d43b1d0c..9cf36b00e 100644 --- a/src/cli/settings/get.rs +++ b/src/cli/settings/get.rs @@ -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"); } } diff --git a/src/cli/shell.rs b/src/cli/shell.rs index c09c3069c..d3cd6e861 100644 --- a/src/cli/shell.rs +++ b/src/cli/shell.rs @@ -98,7 +98,7 @@ mod tests { #[test] fn test_shell() { let err = assert_cli_err!("shell", "tiny@1.0.1"); - assert_display_snapshot!(err); + assert_snapshot!(err); env::set_var("__MISE_DIFF", ""); env::set_var("MISE_SHELL", "zsh"); assert_cli_snapshot!("shell", "tiny@1.0.1"); diff --git a/src/cli/where.rs b/src/cli/where.rs index 81387dd72..522fe38ec 100644 --- a/src/cli/where.rs +++ b/src/cli/where.rs @@ -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"); } } diff --git a/src/config/config_file/mise_toml.rs b/src/config/config_file/mise_toml.rs index 340c231dc..a0a865156 100644 --- a/src/config/config_file/mise_toml.rs +++ b/src/config/config_file/mise_toml.rs @@ -898,7 +898,7 @@ mod tests { let cf: Box = Box::new(cf); with_settings!({ assert_snapshot!(cf.dump().unwrap()); - assert_display_snapshot!(cf); + assert_snapshot!(cf); assert_debug_snapshot!(cf); }); } @@ -1029,7 +1029,7 @@ mod tests { assert_debug_snapshot!(cf.alias); let cf: Box = Box::new(cf); - assert_display_snapshot!(cf); + assert_snapshot!(cf); file::remove_file(&p).unwrap(); } @@ -1057,7 +1057,7 @@ mod tests { assert_debug_snapshot!(cf.alias); let cf: Box = Box::new(cf); assert_snapshot!(cf.dump().unwrap()); - assert_display_snapshot!(cf); + assert_snapshot!(cf); assert_debug_snapshot!(cf); file::remove_file(&p).unwrap(); } @@ -1081,7 +1081,7 @@ mod tests { assert_debug_snapshot!(cf.to_toolset().unwrap()); let cf: Box = Box::new(cf); assert_snapshot!(cf.dump().unwrap()); - assert_display_snapshot!(cf); + assert_snapshot!(cf); assert_debug_snapshot!(cf); } @@ -1102,7 +1102,7 @@ mod tests { assert_debug_snapshot!(cf.to_toolset().unwrap()); let cf: Box = Box::new(cf); assert_snapshot!(cf.dump().unwrap()); - assert_display_snapshot!(cf); + assert_snapshot!(cf); assert_debug_snapshot!(cf); } diff --git a/src/config/config_file/tool_versions.rs b/src/config/config_file/tool_versions.rs index 6ff777d7b..388ca51c1 100644 --- a/src/config/config_file/tool_versions.rs +++ b/src/config/config_file/tool_versions.rs @@ -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] @@ -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(), @"ruby@3.0.5 ruby@3.1"); + assert_snapshot!(tv.to_toolset().unwrap(), @"ruby@3.0.5 ruby@3.1"); } } diff --git a/src/direnv.rs b/src/direnv.rs index 40134150c..b86ee518e 100644 --- a/src/direnv.rs +++ b/src/direnv.rs @@ -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] @@ -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] @@ -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] @@ -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()); } } diff --git a/src/toolset/tool_version.rs b/src/toolset/tool_version.rs index 4544321fd..9d5fa2d5e 100644 --- a/src/toolset/tool_version.rs +++ b/src/toolset/tool_version.rs @@ -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,