diff options
Diffstat (limited to 'crates/shirabe/tests/util')
| -rw-r--r-- | crates/shirabe/tests/util/auth_helper_test.rs | 6 | ||||
| -rw-r--r-- | crates/shirabe/tests/util/filesystem_test.rs | 4 | ||||
| -rw-r--r-- | crates/shirabe/tests/util/gitlab_test.rs | 2 | ||||
| -rw-r--r-- | crates/shirabe/tests/util/perforce_test.rs | 2 | ||||
| -rw-r--r-- | crates/shirabe/tests/util/stream_context_factory_test.rs | 22 |
5 files changed, 17 insertions, 19 deletions
diff --git a/crates/shirabe/tests/util/auth_helper_test.rs b/crates/shirabe/tests/util/auth_helper_test.rs index 133fd75..b760fc8 100644 --- a/crates/shirabe/tests/util/auth_helper_test.rs +++ b/crates/shirabe/tests/util/auth_helper_test.rs @@ -470,7 +470,7 @@ fn expected_auth_setting(username: &str, password: &str) -> PhpMixed { #[test] fn test_store_auth_automatically() { - let mut f = set_up(); + let f = set_up(); let origin = "github.com"; expects_authentication(&f.io, origin, "my_username", "my_password"); @@ -497,7 +497,7 @@ fn test_store_auth_automatically() { #[test] fn test_store_auth_with_prompt_yes_answer() { - let mut f = set_up(); + let f = set_up(); let origin = "github.com"; expects_authentication(&f.io, origin, "my_username", "my_password"); let config_source_name = "https://api.gitlab.com/source"; @@ -536,7 +536,7 @@ fn test_store_auth_with_prompt_yes_answer() { #[test] fn test_store_auth_with_prompt_no_answer() { - let mut f = set_up(); + let f = set_up(); let origin = "github.com"; let config_source_name = "https://api.gitlab.com/source"; diff --git a/crates/shirabe/tests/util/filesystem_test.rs b/crates/shirabe/tests/util/filesystem_test.rs index e0bb46b..2e160e8 100644 --- a/crates/shirabe/tests/util/filesystem_test.rs +++ b/crates/shirabe/tests/util/filesystem_test.rs @@ -5,9 +5,7 @@ // place of TestCase::getUniqueTmpDirectory, which is not ported. use shirabe::util::filesystem::Filesystem; use shirabe::util::platform::Platform; -use shirabe_php_shim::{ - dirname, file_exists, file_put_contents, is_dir, is_file, mkdir, symlink, touch, -}; +use shirabe_php_shim::{file_exists, file_put_contents, is_dir, mkdir, symlink, touch}; // PHP's setUp/tearDown build workingDir/testFile under TestCase::getUniqueTmpDirectory; the // on-disk tests below instead create their own tempfile::TempDir inline, so no shared fixture diff --git a/crates/shirabe/tests/util/gitlab_test.rs b/crates/shirabe/tests/util/gitlab_test.rs index 5a91415..ebf7c08 100644 --- a/crates/shirabe/tests/util/gitlab_test.rs +++ b/crates/shirabe/tests/util/gitlab_test.rs @@ -7,7 +7,7 @@ use shirabe::config::{Config, ConfigSourceInterface}; use shirabe::io::IOInterface; use shirabe::io::io_interface; use shirabe::util::GitLab; -use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler}; +use shirabe::util::http_downloader::HttpDownloaderMockHandler; use shirabe_php_shim::PhpMixed; use crate::config_stub::ConfigStubBuilder; diff --git a/crates/shirabe/tests/util/perforce_test.rs b/crates/shirabe/tests/util/perforce_test.rs index 4f3cb58..482094f 100644 --- a/crates/shirabe/tests/util/perforce_test.rs +++ b/crates/shirabe/tests/util/perforce_test.rs @@ -8,7 +8,7 @@ use serial_test::serial; use shirabe::io::{IOInterface, NullIO}; use shirabe::util::Perforce; use shirabe::util::filesystem::Filesystem; -use shirabe::util::process_executor::{MockExpectation, MockHandler, ProcessExecutor}; +use shirabe::util::process_executor::{MockHandler, ProcessExecutor}; use shirabe_php_shim::PhpMixed; use crate::io_stub::IOStub; diff --git a/crates/shirabe/tests/util/stream_context_factory_test.rs b/crates/shirabe/tests/util/stream_context_factory_test.rs index ad123aa..284077b 100644 --- a/crates/shirabe/tests/util/stream_context_factory_test.rs +++ b/crates/shirabe/tests/util/stream_context_factory_test.rs @@ -324,16 +324,16 @@ fn test_ssl_proxy() { )]); assert_eq!(expected_options, options); } else { - match StreamContextFactory::get_context( - "http://example.org", - IndexMap::new(), - IndexMap::new(), - ) { - // The catch in PHP asserts the exception is a TransportException; the return type - // here already guarantees that. - Ok(_) => panic!(), - Err(_) => {} - } + // The catch in PHP asserts the exception is a TransportException; the return type + // here already guarantees that. + assert!( + StreamContextFactory::get_context( + "http://example.org", + IndexMap::new(), + IndexMap::new(), + ) + .is_err() + ); } } } @@ -351,7 +351,7 @@ fn test_ensure_thatfix_http_header_field_moves_content_type_to_end_of_options() ), )]), )]); - let expected_header = vec