aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/tests')
-rw-r--r--crates/shirabe/tests/advisory/auditor_test.rs7
-rw-r--r--crates/shirabe/tests/application_test.rs5
-rw-r--r--crates/shirabe/tests/autoload/autoload_generator_test.rs11
-rw-r--r--crates/shirabe/tests/cache_test.rs7
-rw-r--r--crates/shirabe/tests/command/archive_command_test.rs8
-rw-r--r--crates/shirabe/tests/command/exec_command_test.rs2
-rw-r--r--crates/shirabe/tests/command/run_script_command_test.rs3
-rw-r--r--crates/shirabe/tests/common/config_stub.rs5
-rw-r--r--crates/shirabe/tests/common/http_downloader_mock.rs5
-rw-r--r--crates/shirabe/tests/common/io_mock.rs7
-rw-r--r--crates/shirabe/tests/common/process_executor_mock.rs5
-rw-r--r--crates/shirabe/tests/composer_test.rs5
-rw-r--r--crates/shirabe/tests/config_test.rs5
-rw-r--r--crates/shirabe/tests/dependency_resolver/default_policy_test.rs3
-rw-r--r--crates/shirabe/tests/dependency_resolver/pool_builder_test.rs7
-rw-r--r--crates/shirabe/tests/dependency_resolver/pool_optimizer_test.rs5
-rw-r--r--crates/shirabe/tests/dependency_resolver/pool_test.rs3
-rw-r--r--crates/shirabe/tests/dependency_resolver/rule_set_iterator_test.rs5
-rw-r--r--crates/shirabe/tests/dependency_resolver/rule_set_test.rs8
-rw-r--r--crates/shirabe/tests/dependency_resolver/rule_test.rs3
-rw-r--r--crates/shirabe/tests/dependency_resolver/solver_test.rs8
-rw-r--r--crates/shirabe/tests/dependency_resolver/transaction_test.rs3
-rw-r--r--crates/shirabe/tests/documentation_test.rs5
-rw-r--r--crates/shirabe/tests/downloader/archive_downloader_test.rs5
-rw-r--r--crates/shirabe/tests/downloader/download_manager_test.rs8
-rw-r--r--crates/shirabe/tests/downloader/file_downloader_test.rs12
-rw-r--r--crates/shirabe/tests/downloader/fossil_downloader_test.rs12
-rw-r--r--crates/shirabe/tests/downloader/git_downloader_test.rs14
-rw-r--r--crates/shirabe/tests/downloader/hg_downloader_test.rs10
-rw-r--r--crates/shirabe/tests/downloader/perforce_downloader_test.rs12
-rw-r--r--crates/shirabe/tests/downloader/xz_downloader_test.rs5
-rw-r--r--crates/shirabe/tests/downloader/zip_downloader_test.rs8
-rw-r--r--crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs10
-rw-r--r--crates/shirabe/tests/factory_test.rs5
-rw-r--r--crates/shirabe/tests/installer/binary_installer_test.rs13
-rw-r--r--crates/shirabe/tests/installer/installation_manager_test.rs8
-rw-r--r--crates/shirabe/tests/installer/installer_event_test.rs5
-rw-r--r--crates/shirabe/tests/installer/library_installer_test.rs13
-rw-r--r--crates/shirabe/tests/installer/metapackage_installer_test.rs8
-rw-r--r--crates/shirabe/tests/installer/suggested_packages_reporter_test.rs10
-rw-r--r--crates/shirabe/tests/package/archiver/archive_manager_test.rs5
-rw-r--r--crates/shirabe/tests/package/base_package_test.rs3
-rw-r--r--crates/shirabe/tests/package/loader/root_package_loader_test.rs8
-rw-r--r--crates/shirabe/tests/package/loader/validating_array_loader_test.rs3
-rw-r--r--crates/shirabe/tests/package/locker_test.rs5
-rw-r--r--crates/shirabe/tests/package/version/version_guesser_test.rs8
-rw-r--r--crates/shirabe/tests/package/version/version_selector_test.rs11
-rw-r--r--crates/shirabe/tests/question/strict_confirmation_question_test.rs5
-rw-r--r--crates/shirabe/tests/repository/array_repository_test.rs3
-rw-r--r--crates/shirabe/tests/repository/artifact_repository_test.rs5
-rw-r--r--crates/shirabe/tests/repository/composer_repository_test.rs8
-rw-r--r--crates/shirabe/tests/repository/composite_repository_test.rs3
-rw-r--r--crates/shirabe/tests/repository/filesystem_repository_test.rs8
-rw-r--r--crates/shirabe/tests/repository/filter_repository_test.rs3
-rw-r--r--crates/shirabe/tests/repository/installed_repository_test.rs3
-rw-r--r--crates/shirabe/tests/repository/path_repository_test.rs8
-rw-r--r--crates/shirabe/tests/repository/repository_factory_test.rs5
-rw-r--r--crates/shirabe/tests/repository/repository_manager_test.rs5
-rw-r--r--crates/shirabe/tests/repository/repository_utils_test.rs3
-rw-r--r--crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs10
-rw-r--r--crates/shirabe/tests/repository/vcs/fossil_driver_test.rs5
-rw-r--r--crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs10
-rw-r--r--crates/shirabe/tests/repository/vcs/git_driver_test.rs12
-rw-r--r--crates/shirabe/tests/repository/vcs/github_driver_test.rs16
-rw-r--r--crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs10
-rw-r--r--crates/shirabe/tests/repository/vcs/hg_driver_test.rs12
-rw-r--r--crates/shirabe/tests/repository/vcs/perforce_driver_test.rs8
-rw-r--r--crates/shirabe/tests/repository/vcs/svn_driver_test.rs12
-rw-r--r--crates/shirabe/tests/repository/vcs_repository_test.rs18
-rw-r--r--crates/shirabe/tests/script/event_test.rs5
-rw-r--r--crates/shirabe/tests/util/auth_helper_test.rs10
-rw-r--r--crates/shirabe/tests/util/bitbucket_test.rs14
-rw-r--r--crates/shirabe/tests/util/config_validator_test.rs5
-rw-r--r--crates/shirabe/tests/util/forgejo_test.rs12
-rw-r--r--crates/shirabe/tests/util/git_test.rs14
-rw-r--r--crates/shirabe/tests/util/github_test.rs12
-rw-r--r--crates/shirabe/tests/util/gitlab_test.rs12
-rw-r--r--crates/shirabe/tests/util/http_downloader_test.rs10
-rw-r--r--crates/shirabe/tests/util/perforce_test.rs10
-rw-r--r--crates/shirabe/tests/util/process_executor_test.rs5
-rw-r--r--crates/shirabe/tests/util/remote_filesystem_test.rs10
-rw-r--r--crates/shirabe/tests/util/svn_test.rs5
82 files changed, 249 insertions, 373 deletions
diff --git a/crates/shirabe/tests/advisory/auditor_test.rs b/crates/shirabe/tests/advisory/auditor_test.rs
index 516c4d1..c908f0b 100644
--- a/crates/shirabe/tests/advisory/auditor_test.rs
+++ b/crates/shirabe/tests/advisory/auditor_test.rs
@@ -1,5 +1,8 @@
//! ref: composer/tests/Composer/Test/Advisory/AuditorTest.php
+use crate::io_mock::{Expectation, get_io_mock};
+use crate::test_case::get_complete_package;
+use crate::test_case::get_package;
use chrono::Utc;
use indexmap::IndexMap;
use shirabe::advisory::AnySecurityAdvisory;
@@ -26,10 +29,6 @@ use shirabe_semver::VersionParser;
use shirabe_semver::constraint::AnyConstraint;
use shirabe_semver::constraint::SimpleConstraint;
-use crate::io_mock::{Expectation, get_io_mock};
-use crate::test_case::get_complete_package;
-use crate::test_case::get_package;
-
fn constraint(operator: &str, version: &str) -> shirabe_semver::constraint::AnyConstraint {
SimpleConstraint::new(operator.to_string(), version.to_string(), None).into()
}
diff --git a/crates/shirabe/tests/application_test.rs b/crates/shirabe/tests/application_test.rs
index d54f43b..a513189 100644
--- a/crates/shirabe/tests/application_test.rs
+++ b/crates/shirabe/tests/application_test.rs
@@ -5,9 +5,6 @@
// Symfony command-registry model), or a runtime define() of COMPOSER_DEV_WARNING_TIME,
// remain unportable.
-use std::cell::RefCell;
-use std::rc::Rc;
-
use shirabe::command::about_command::AboutCommand;
use shirabe::command::self_update_command::SelfUpdateCommand;
use shirabe::console::application::ApplicationHandle;
@@ -18,6 +15,8 @@ use shirabe_external_packages::symfony::console::input::input_interface::InputIn
use shirabe_external_packages::symfony::console::output::buffered_output::BufferedOutput;
use shirabe_external_packages::symfony::console::output::output_interface::OutputInterface;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
fn set_up() {
Platform::put_env("COMPOSER_DISABLE_XDEBUG_WARN", "1");
diff --git a/crates/shirabe/tests/autoload/autoload_generator_test.rs b/crates/shirabe/tests/autoload/autoload_generator_test.rs
index d5f16fb..73182a2 100644
--- a/crates/shirabe/tests/autoload/autoload_generator_test.rs
+++ b/crates/shirabe/tests/autoload/autoload_generator_test.rs
@@ -1,12 +1,8 @@
//! ref: composer/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
use indexmap::IndexMap;
use serial_test::serial;
-use tempfile::TempDir;
-
use shirabe::autoload::AutoloadGenerator;
use shirabe::composer::{ComposerHandle, PartialOrFullComposer};
use shirabe::config::Config;
@@ -23,8 +19,9 @@ use shirabe::util::r#loop::Loop;
use shirabe_external_packages::symfony::console::output::output_interface;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::constraint::{AnyConstraint, MatchAllConstraint, SimpleConstraint};
-
-use crate::config_stub::ConfigStubBuilder;
+use std::cell::RefCell;
+use std::rc::Rc;
+use tempfile::TempDir;
/// The mock `InstallationManager::getInstallPath` used throughout the test: metapackages return
/// null, every other package returns `vendorDir/<name>(/<targetDir>)`. Registered as an installer
diff --git a/crates/shirabe/tests/cache_test.rs b/crates/shirabe/tests/cache_test.rs
index 7705714..b9644dc 100644
--- a/crates/shirabe/tests/cache_test.rs
+++ b/crates/shirabe/tests/cache_test.rs
@@ -1,13 +1,12 @@
//! ref: composer/tests/Composer/Test/CacheTest.php
-use std::cell::RefCell;
-use std::fs;
-use std::rc::Rc;
-
use shirabe::cache::{Cache, CacheMock, GcFinderMock};
use shirabe::io::IOInterface;
use shirabe::io::null_io::NullIO;
use shirabe::util::filesystem::Filesystem;
+use std::cell::RefCell;
+use std::fs;
+use std::rc::Rc;
use tempfile::TempDir;
struct SetUp {
diff --git a/crates/shirabe/tests/command/archive_command_test.rs b/crates/shirabe/tests/command/archive_command_test.rs
index e7730b9..991f615 100644
--- a/crates/shirabe/tests/command/archive_command_test.rs
+++ b/crates/shirabe/tests/command/archive_command_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Command/ArchiveCommandTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
use indexmap::IndexMap;
use shirabe::command::BaseCommand;
use shirabe::command::archive_command::ArchiveCommand;
@@ -24,8 +22,8 @@ use shirabe_external_packages::symfony::console::output::OutputInterface;
use shirabe_external_packages::symfony::console::output::buffered_output::BufferedOutput;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
-
-use crate::config_stub::ConfigStubBuilder;
+use std::cell::RefCell;
+use std::rc::Rc;
// PHP mocks `Composer\Package\Archiver\ArchiveManager` with
// getMockBuilder(...)->disableOriginalConstructor().
diff --git a/crates/shirabe/tests/command/exec_command_test.rs b/crates/shirabe/tests/command/exec_command_test.rs
index 95649f7..03a2c7c 100644
--- a/crates/shirabe/tests/command/exec_command_test.rs
+++ b/crates/shirabe/tests/command/exec_command_test.rs
@@ -71,7 +71,7 @@ fn test_list() {
let output = app_tester.get_display();
- assert_eq!("Available binaries:\n- b\n- c\n- a (local)", output.trim(),);
+ assert_eq!("Available binaries:\n- b\n- c\n- a (local)", output.trim());
drop(tear_down);
}
diff --git a/crates/shirabe/tests/command/run_script_command_test.rs b/crates/shirabe/tests/command/run_script_command_test.rs
index 6cd4a2e..75cf678 100644
--- a/crates/shirabe/tests/command/run_script_command_test.rs
+++ b/crates/shirabe/tests/command/run_script_command_test.rs
@@ -1,9 +1,8 @@
//! ref: composer/tests/Composer/Test/Command/RunScriptCommandTest.php
-use shirabe_php_shim::PhpMixed;
-
use crate::test_case::{RunOptions, get_application_tester, init_temp_composer};
use serial_test::serial;
+use shirabe_php_shim::PhpMixed;
/// ref: RunScriptCommandTest::testDetectAndPassDevModeToEventAndToDispatching
///
diff --git a/crates/shirabe/tests/common/config_stub.rs b/crates/shirabe/tests/common/config_stub.rs
index 7566b89..bf81462 100644
--- a/crates/shirabe/tests/common/config_stub.rs
+++ b/crates/shirabe/tests/common/config_stub.rs
@@ -8,12 +8,11 @@
//! real resolution logic instead of intercepting `get`.
#![allow(dead_code)]
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
pub struct ConfigStubBuilder {
use_environment: bool,
diff --git a/crates/shirabe/tests/common/http_downloader_mock.rs b/crates/shirabe/tests/common/http_downloader_mock.rs
index 7a021f9..85d3ec8 100644
--- a/crates/shirabe/tests/common/http_downloader_mock.rs
+++ b/crates/shirabe/tests/common/http_downloader_mock.rs
@@ -1,9 +1,6 @@
//! ref: composer/tests/Composer/Test/Mock/HttpDownloaderMock.php
#![allow(dead_code)]
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -12,6 +9,8 @@ use shirabe::util::http_downloader::{
HttpDownloader, HttpDownloaderMockExpectation, HttpDownloaderMockHandler,
};
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
// A single HTTP request expectation as written in the PHP tests: a `url` plus an
// optional response (`status`/`body`/`headers`). `options` of `None` matches any
diff --git a/crates/shirabe/tests/common/io_mock.rs b/crates/shirabe/tests/common/io_mock.rs
index bdbe7b3..7b932a8 100644
--- a/crates/shirabe/tests/common/io_mock.rs
+++ b/crates/shirabe/tests/common/io_mock.rs
@@ -1,9 +1,5 @@
//! ref: composer/tests/Composer/Test/Mock/IOMock.php
-use std::cell::RefCell;
-use std::collections::VecDeque;
-use std::rc::Rc;
-
use shirabe::config::Config;
use shirabe::io::buffer_io::BufferIO;
use shirabe::io::io_interface;
@@ -12,6 +8,9 @@ use shirabe::util::platform::Platform;
use shirabe_external_packages::composer::pcre::Preg;
use shirabe_external_packages::symfony::console::output::output_interface;
use shirabe_php_shim::{PHP_EOL, PhpMixed, preg_quote};
+use std::cell::RefCell;
+use std::collections::VecDeque;
+use std::rc::Rc;
// A single entry of the IO expectation list. PHP models these as associative
// arrays (`{text, regex?}` / `{ask, reply}` / `{auth: [repo, user, pass]}`); the
diff --git a/crates/shirabe/tests/common/process_executor_mock.rs b/crates/shirabe/tests/common/process_executor_mock.rs
index b81c8bb..698d8d2 100644
--- a/crates/shirabe/tests/common/process_executor_mock.rs
+++ b/crates/shirabe/tests/common/process_executor_mock.rs
@@ -1,10 +1,9 @@
//! ref: composer/tests/Composer/Test/Mock/ProcessExecutorMock.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use shirabe::util::process_executor::{MockExpectation, MockHandler, ProcessExecutor};
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
// A command expectation as written in the PHP tests: either a bare command
// (`'git command'` / `['git', '--version']`) or the full
diff --git a/crates/shirabe/tests/composer_test.rs b/crates/shirabe/tests/composer_test.rs
index bffe4ce..c394f1e 100644
--- a/crates/shirabe/tests/composer_test.rs
+++ b/crates/shirabe/tests/composer_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/ComposerTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::composer::Composer;
use shirabe::config::Config;
@@ -19,6 +16,8 @@ use shirabe::repository::RepositoryManagerInterface;
use shirabe::util::http_downloader::HttpDownloader;
use shirabe::util::r#loop::Loop;
use shirabe::util::process_executor::ProcessExecutor;
+use std::cell::RefCell;
+use std::rc::Rc;
fn null_io() -> Rc<RefCell<dyn IOInterface>> {
Rc::new(RefCell::new(NullIO::new()))
diff --git a/crates/shirabe/tests/config_test.rs b/crates/shirabe/tests/config_test.rs
index b7eb5a5..61a1575 100644
--- a/crates/shirabe/tests/config_test.rs
+++ b/crates/shirabe/tests/config_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/ConfigTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::advisory::Auditor;
@@ -11,6 +8,8 @@ use shirabe::io::IOInterface;
use shirabe::io::io_interface;
use shirabe::util::Platform;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
#[path = "common/io_mock.rs"]
#[allow(dead_code)] // io_mock exposes more helpers than this binary uses
diff --git a/crates/shirabe/tests/dependency_resolver/default_policy_test.rs b/crates/shirabe/tests/dependency_resolver/default_policy_test.rs
index 5b7995b..3757715 100644
--- a/crates/shirabe/tests/dependency_resolver/default_policy_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/default_policy_test.rs
@@ -1,5 +1,6 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/DefaultPolicyTest.php
+use crate::test_case::get_package;
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::dependency_resolver::PolicyInterface;
@@ -13,8 +14,6 @@ use shirabe::repository::repository_set::RepositorySet;
use shirabe::util::platform::Platform;
use shirabe_semver::constraint::{AnyConstraint, SimpleConstraint};
-use crate::test_case::get_package;
-
#[allow(dead_code)]
struct Fixtures {
repository_set: RepositorySet,
diff --git a/crates/shirabe/tests/dependency_resolver/pool_builder_test.rs b/crates/shirabe/tests/dependency_resolver/pool_builder_test.rs
index 0a6b0ca..548cb0d 100644
--- a/crates/shirabe/tests/dependency_resolver/pool_builder_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/pool_builder_test.rs
@@ -1,9 +1,5 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/PoolBuilderTest.php
-use std::cell::RefCell;
-use std::path::PathBuf;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::dependency_resolver::default_policy::DefaultPolicy;
@@ -26,6 +22,9 @@ use shirabe::repository::repository_set::{RepositorySet, RootAliasInput};
use shirabe_external_packages::composer::pcre::preg::Preg;
use shirabe_php_shim::PREG_SPLIT_DELIM_CAPTURE;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::path::PathBuf;
+use std::rc::Rc;
/// Maps the PHP `$loadPackage` closure: pops the optional `id` from the data, loads the
/// package and records it in `package_ids` keyed by that id (erroring on duplicates).
diff --git a/crates/shirabe/tests/dependency_resolver/pool_optimizer_test.rs b/crates/shirabe/tests/dependency_resolver/pool_optimizer_test.rs
index b5f70a1..3c4952e 100644
--- a/crates/shirabe/tests/dependency_resolver/pool_optimizer_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/pool_optimizer_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/PoolOptimizerTest.php
-use std::path::PathBuf;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::dependency_resolver::default_policy::DefaultPolicy;
use shirabe::dependency_resolver::pool::Pool;
@@ -17,6 +14,8 @@ use shirabe::repository::lock_array_repository::LockArrayRepository;
use shirabe_external_packages::composer::pcre::preg::Preg;
use shirabe_php_shim::PREG_SPLIT_DELIM_CAPTURE;
use shirabe_php_shim::PhpMixed;
+use std::path::PathBuf;
+use std::rc::Rc;
fn load_package(package_data: &PhpMixed) -> BasePackageHandle {
let loader = ArrayLoader::new(None, false);
diff --git a/crates/shirabe/tests/dependency_resolver/pool_test.rs b/crates/shirabe/tests/dependency_resolver/pool_test.rs
index b2bd0db..409420b 100644
--- a/crates/shirabe/tests/dependency_resolver/pool_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/pool_test.rs
@@ -1,11 +1,10 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/PoolTest.php
+use crate::test_case::{get_package, get_version_constraint};
use indexmap::IndexMap;
use shirabe::dependency_resolver::pool::Pool;
use shirabe::package::handle::PackageInterfaceHandle;
-use crate::test_case::{get_package, get_version_constraint};
-
// ref: PoolTest::createPool
fn create_pool(packages: Vec<PackageInterfaceHandle>) -> Pool {
Pool::new(
diff --git a/crates/shirabe/tests/dependency_resolver/rule_set_iterator_test.rs b/crates/shirabe/tests/dependency_resolver/rule_set_iterator_test.rs
index 44013aa..9c9f85b 100644
--- a/crates/shirabe/tests/dependency_resolver/rule_set_iterator_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/rule_set_iterator_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::dependency_resolver::generic_rule::GenericRule;
use shirabe::dependency_resolver::pool::Pool;
@@ -10,6 +7,8 @@ use shirabe::dependency_resolver::rule::{RULE_LEARNED, RULE_ROOT_REQUIRE, Reason
use shirabe::dependency_resolver::rule_set::RuleSet;
use shirabe::dependency_resolver::rule_set_iterator::RuleSetIterator;
use shirabe_semver::constraint::MatchAllConstraint;
+use std::cell::RefCell;
+use std::rc::Rc;
type Rules = IndexMap<i64, Vec<Rc<RefCell<Rule>>>>;
diff --git a/crates/shirabe/tests/dependency_resolver/rule_set_test.rs b/crates/shirabe/tests/dependency_resolver/rule_set_test.rs
index c1faa11..3ed974e 100644
--- a/crates/shirabe/tests/dependency_resolver/rule_set_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/rule_set_test.rs
@@ -1,16 +1,14 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/RuleSetTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::test_case::get_package;
use indexmap::IndexMap;
use shirabe::dependency_resolver::{
GenericRule, Pool, RULE_LEARNED, RULE_ROOT_REQUIRE, ReasonData, Request, Rule, RuleSet,
};
use shirabe::repository::RepositorySet;
use shirabe_semver::constraint::{MatchAllConstraint, MatchNoneConstraint};
-
-use crate::test_case::get_package;
+use std::cell::RefCell;
+use std::rc::Rc;
fn root_require_reason() -> ReasonData {
ReasonData::RootRequire {
diff --git a/crates/shirabe/tests/dependency_resolver/rule_test.rs b/crates/shirabe/tests/dependency_resolver/rule_test.rs
index 8216848..6bfb7bd 100644
--- a/crates/shirabe/tests/dependency_resolver/rule_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/rule_test.rs
@@ -1,5 +1,6 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/RuleTest.php
+use crate::test_case::get_package;
use indexmap::IndexMap;
use shirabe::dependency_resolver::{
GenericRule, Pool, RULE_PACKAGE_REQUIRES, RULE_ROOT_REQUIRE, ReasonData, Request, Rule, RuleSet,
@@ -9,8 +10,6 @@ use shirabe::repository::RepositorySet;
use shirabe_php_shim::{PHP_VERSION_ID, hash_raw, unpack};
use shirabe_semver::constraint::MatchAllConstraint;
-use crate::test_case::get_package;
-
fn root_require_reason() -> ReasonData {
ReasonData::RootRequire {
package_name: String::new(),
diff --git a/crates/shirabe/tests/dependency_resolver/solver_test.rs b/crates/shirabe/tests/dependency_resolver/solver_test.rs
index 4f24003..c20fd4c 100644
--- a/crates/shirabe/tests/dependency_resolver/solver_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/solver_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/SolverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::test_case::{get_alias_package, get_package, get_version_constraint};
use indexmap::IndexMap;
use shirabe::dependency_resolver::PolicyInterface;
use shirabe::dependency_resolver::default_policy::DefaultPolicy;
@@ -18,8 +16,8 @@ use shirabe::repository::handle::{LockArrayRepositoryHandle, RepositoryInterface
use shirabe::repository::lock_array_repository::LockArrayRepository;
use shirabe::repository::repository_set::RepositorySet;
use shirabe_semver::constraint::{AnyConstraint, MatchAllConstraint, MultiConstraint};
-
-use crate::test_case::{get_alias_package, get_package, get_version_constraint};
+use std::cell::RefCell;
+use std::rc::Rc;
#[allow(dead_code)]
struct Fixtures {
diff --git a/crates/shirabe/tests/dependency_resolver/transaction_test.rs b/crates/shirabe/tests/dependency_resolver/transaction_test.rs
index 7835e47..99f31c3 100644
--- a/crates/shirabe/tests/dependency_resolver/transaction_test.rs
+++ b/crates/shirabe/tests/dependency_resolver/transaction_test.rs
@@ -1,13 +1,12 @@
//! ref: composer/tests/Composer/Test/DependencyResolver/TransactionTest.php
+use crate::test_case::{get_alias_package, get_package, get_version_constraint};
use indexmap::IndexMap;
use shirabe::dependency_resolver::transaction::Transaction;
use shirabe::package::Link;
use shirabe::package::handle::PackageInterfaceHandle;
use shirabe_php_shim::PhpMixed;
-use crate::test_case::{get_alias_package, get_package, get_version_constraint};
-
/// PHP `new Link($source, $target, $constraint, $type)`: prettyConstraint defaults to
/// `(string) $constraint`.
fn mk_link(
diff --git a/crates/shirabe/tests/documentation_test.rs b/crates/shirabe/tests/documentation_test.rs
index 4fe9a94..7dc049c 100644
--- a/crates/shirabe/tests/documentation_test.rs
+++ b/crates/shirabe/tests/documentation_test.rs
@@ -1,11 +1,10 @@
//! ref: composer/tests/Composer/Test/DocumentationTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use shirabe::console::application::ApplicationHandle;
use shirabe_external_packages::symfony::console::command::Command;
use shirabe_external_packages::symfony::console::descriptor::application_description::ApplicationDescription;
+use std::cell::RefCell;
+use std::rc::Rc;
fn get_command_name(command: &Rc<RefCell<dyn Command>>) -> String {
let mut name = command.borrow().get_name().unwrap_or_default();
diff --git a/crates/shirabe/tests/downloader/archive_downloader_test.rs b/crates/shirabe/tests/downloader/archive_downloader_test.rs
index 3543c2e..fedbae9 100644
--- a/crates/shirabe/tests/downloader/archive_downloader_test.rs
+++ b/crates/shirabe/tests/downloader/archive_downloader_test.rs
@@ -6,9 +6,6 @@
// real Config merged with `vendor-dir`, and real CompletePackage instances with dist
// url/reference set.
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::downloader::FileDownloader;
@@ -18,6 +15,8 @@ use shirabe::package::handle::{CompletePackageHandle, PackageInterfaceHandle};
use shirabe::util::HttpDownloader;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
+use std::cell::RefCell;
+use std::rc::Rc;
/// ref: TestCase::getPackage (default class CompletePackage)
fn get_package(name: &str, version: &str) -> PackageInterfaceHandle {
diff --git a/crates/shirabe/tests/downloader/download_manager_test.rs b/crates/shirabe/tests/downloader/download_manager_test.rs
index e18643e..3b259c8 100644
--- a/crates/shirabe/tests/downloader/download_manager_test.rs
+++ b/crates/shirabe/tests/downloader/download_manager_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Downloader/DownloadManagerTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::io_stub::IOStub;
use indexmap::IndexMap;
use shirabe::downloader::DownloaderInterface;
use shirabe::downloader::download_manager::DownloadManager;
@@ -10,8 +8,8 @@ use shirabe::io::IOInterface;
use shirabe::package::handle::{CompletePackageHandle, PackageInterfaceHandle};
use shirabe_php_shim::{PhpMixed, RuntimeException};
use shirabe_semver::VersionParser;
-
-use crate::io_stub::IOStub;
+use std::cell::RefCell;
+use std::rc::Rc;
// PHP mocks `Composer\Downloader\DownloaderInterface` with getMockBuilder.
mockall::mock! {
diff --git a/crates/shirabe/tests/downloader/file_downloader_test.rs b/crates/shirabe/tests/downloader/file_downloader_test.rs
index 6f7025e..ead577e 100644
--- a/crates/shirabe/tests/downloader/file_downloader_test.rs
+++ b/crates/shirabe/tests/downloader/file_downloader_test.rs
@@ -1,8 +1,7 @@
//! ref: composer/tests/Composer/Test/Downloader/FileDownloaderTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::get_http_downloader_mock;
+use crate::io_mock::{Expectation, get_io_mock};
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::cache::{Cache, CacheMock};
@@ -15,17 +14,16 @@ use shirabe::io::null_io::NullIO;
use shirabe::package::handle::{CompletePackageHandle, PackageInterfaceHandle};
use shirabe::util::HttpDownloader;
use shirabe::util::filesystem::{Filesystem, FilesystemMock};
+use shirabe::util::http_downloader::HttpDownloaderMockHandler;
use shirabe::util::r#loop::Loop;
use shirabe_php_shim::{
InvalidArgumentException, PhpMixed, RuntimeException, UnexpectedValueException,
};
use shirabe_semver::VersionParser;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::http_downloader_mock::get_http_downloader_mock;
-use crate::io_mock::{Expectation, get_io_mock};
-use shirabe::util::http_downloader::HttpDownloaderMockHandler;
-
/// ref: TestCase::getPackage (default class CompletePackage)
fn get_package(name: &str, version: &str) -> PackageInterfaceHandle {
let norm_version = VersionParser.normalize(version, None).unwrap();
diff --git a/crates/shirabe/tests/downloader/fossil_downloader_test.rs b/crates/shirabe/tests/downloader/fossil_downloader_test.rs
index 2c47ac9..912b4b4 100644
--- a/crates/shirabe/tests/downloader/fossil_downloader_test.rs
+++ b/crates/shirabe/tests/downloader/fossil_downloader_test.rs
@@ -1,8 +1,8 @@
//! ref: composer/tests/Composer/Test/Downloader/FossilDownloaderTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::get_process_executor_mock;
use shirabe::config::Config;
use shirabe::downloader::VcsDownloader;
use shirabe::downloader::fossil_downloader::FossilDownloader;
@@ -12,12 +12,10 @@ use shirabe::util::ProcessExecutor;
use shirabe::util::filesystem::{Filesystem, FilesystemMock};
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::config_stub::ConfigStubBuilder;
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::get_process_executor_mock;
-
fn run<F: std::future::Future>(future: F) -> F::Output {
tokio::runtime::Builder::new_current_thread()
.build()
diff --git a/crates/shirabe/tests/downloader/git_downloader_test.rs b/crates/shirabe/tests/downloader/git_downloader_test.rs
index 77a976e..7e98cae 100644
--- a/crates/shirabe/tests/downloader/git_downloader_test.rs
+++ b/crates/shirabe/tests/downloader/git_downloader_test.rs
@@ -1,8 +1,9 @@
//! ref: composer/tests/Composer/Test/Downloader/GitDownloaderTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::io_mock::{Expectation, get_io_mock};
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::config::Config;
@@ -17,13 +18,10 @@ use shirabe::util::ProcessExecutor;
use shirabe::util::filesystem::Filesystem;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::config_stub::ConfigStubBuilder;
-use crate::io_mock::{Expectation, get_io_mock};
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
-
fn run<F: std::future::Future>(future: F) -> F::Output {
tokio::runtime::Builder::new_current_thread()
.build()
diff --git a/crates/shirabe/tests/downloader/hg_downloader_test.rs b/crates/shirabe/tests/downloader/hg_downloader_test.rs
index 28483f5..e68dfc5 100644
--- a/crates/shirabe/tests/downloader/hg_downloader_test.rs
+++ b/crates/shirabe/tests/downloader/hg_downloader_test.rs
@@ -1,8 +1,7 @@
//! ref: composer/tests/Composer/Test/Downloader/HgDownloaderTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::{cmd, get_process_executor_mock};
use shirabe::config::Config;
use shirabe::downloader::VcsDownloader;
use shirabe::downloader::hg_downloader::HgDownloader;
@@ -11,11 +10,10 @@ use shirabe::package::handle::{CompletePackageHandle, PackageInterfaceHandle};
use shirabe::util::ProcessExecutor;
use shirabe::util::filesystem::{Filesystem, FilesystemMock};
use shirabe_semver::VersionParser;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::{cmd, get_process_executor_mock};
-
fn run<F: std::future::Future>(future: F) -> F::Output {
tokio::runtime::Builder::new_current_thread()
.build()
diff --git a/crates/shirabe/tests/downloader/perforce_downloader_test.rs b/crates/shirabe/tests/downloader/perforce_downloader_test.rs
index f23888a..70f28e1 100644
--- a/crates/shirabe/tests/downloader/perforce_downloader_test.rs
+++ b/crates/shirabe/tests/downloader/perforce_downloader_test.rs
@@ -1,8 +1,8 @@
//! ref: composer/tests/Composer/Test/Downloader/PerforceDownloaderTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::io_mock::{Expectation, get_io_mock};
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::get_process_executor_mock;
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::downloader::VcsDownloader;
@@ -14,12 +14,10 @@ use shirabe::util::filesystem::Filesystem;
use shirabe::util::process_executor::MockHandler;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::io_mock::{Expectation, get_io_mock};
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::get_process_executor_mock;
-
// A getMockBuilder('Composer\Util\Perforce') stand-in: the seam trait extracted from the
// concrete `Perforce` struct, mocked so the downloader's workflow can be verified.
mockall::mock! {
diff --git a/crates/shirabe/tests/downloader/xz_downloader_test.rs b/crates/shirabe/tests/downloader/xz_downloader_test.rs
index d69e7cc..358f896 100644
--- a/crates/shirabe/tests/downloader/xz_downloader_test.rs
+++ b/crates/shirabe/tests/downloader/xz_downloader_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/Downloader/XzDownloaderTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::downloader::DownloaderInterface;
@@ -17,6 +14,8 @@ use shirabe::util::filesystem::Filesystem;
use shirabe::util::r#loop::Loop;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
/// ref: TestCase::getPackage (default class CompletePackage)
diff --git a/crates/shirabe/tests/downloader/zip_downloader_test.rs b/crates/shirabe/tests/downloader/zip_downloader_test.rs
index 055e98f..1d16f66 100644
--- a/crates/shirabe/tests/downloader/zip_downloader_test.rs
+++ b/crates/shirabe/tests/downloader/zip_downloader_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Downloader/ZipDownloaderTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::io_stub::IOStub;
use serial_test::serial;
use shirabe::config::Config;
use shirabe::downloader::ArchiveDownloader;
@@ -14,10 +12,10 @@ use shirabe::util::ProcessExecutor;
use shirabe::util::filesystem::Filesystem;
use shirabe_php_shim::{ZipArchive, ZipArchiveMock};
use shirabe_semver::VersionParser;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::io_stub::IOStub;
-
fn run<F: std::future::Future>(future: F) -> F::Output {
tokio::runtime::Builder::new_current_thread()
.build()
diff --git a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs
index 9e048cf..cabb679 100644
--- a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs
+++ b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs
@@ -1,11 +1,8 @@
//! ref: composer/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::process_executor_mock::{ProcessExecutorMockGuard, cmd, get_process_executor_mock};
use indexmap::IndexMap;
use serial_test::serial;
-
use shirabe::composer::{ComposerHandle, PartialOrFullComposer};
use shirabe::config::Config;
use shirabe::dependency_resolver::Transaction;
@@ -18,11 +15,10 @@ use shirabe::script::Event as ScriptEvent;
use shirabe::script::ScriptEvents;
use shirabe::util::platform::Platform;
use shirabe::util::process_executor::{MockHandler, ProcessExecutor};
-
use shirabe_external_packages::symfony::console::output::output_interface;
use shirabe_php_shim::PHP_EOL;
-
-use crate::process_executor_mock::{ProcessExecutorMockGuard, cmd, get_process_executor_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
fn tear_down() {
Platform::clear_env("COMPOSER_SKIP_SCRIPTS");
diff --git a/crates/shirabe/tests/factory_test.rs b/crates/shirabe/tests/factory_test.rs
index c6464de..8685861 100644
--- a/crates/shirabe/tests/factory_test.rs
+++ b/crates/shirabe/tests/factory_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/FactoryTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::factory::Factory;
@@ -10,6 +7,8 @@ use shirabe::io::IOInterface;
use shirabe::io::io_interface;
use shirabe::util::platform::Platform;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
#[path = "common/config_stub.rs"]
mod config_stub;
diff --git a/crates/shirabe/tests/installer/binary_installer_test.rs b/crates/shirabe/tests/installer/binary_installer_test.rs
index b26907d..6b3cae5 100644
--- a/crates/shirabe/tests/installer/binary_installer_test.rs
+++ b/crates/shirabe/tests/installer/binary_installer_test.rs
@@ -1,19 +1,16 @@
//! ref: composer/tests/Composer/Test/Installer/BinaryInstallerTest.php
-use std::cell::RefCell;
-use std::fs;
-use std::rc::Rc;
-
+use crate::test_case::get_package;
use base64::Engine;
-use tempfile::TempDir;
-
use shirabe::installer::BinaryInstaller;
use shirabe::io::IOInterface;
use shirabe::io::null_io::NullIO;
use shirabe::util::Filesystem;
use shirabe::util::ProcessExecutor;
-
-use crate::test_case::get_package;
+use std::cell::RefCell;
+use std::fs;
+use std::rc::Rc;
+use tempfile::TempDir;
/// Mirror of setUp(): builds temp root/vendor/bin dirs plus a mocked IO. PHP uses a
/// PHPUnit IOInterface mock with no expectations; a NullIO is the closest analogue.
diff --git a/crates/shirabe/tests/installer/installation_manager_test.rs b/crates/shirabe/tests/installer/installation_manager_test.rs
index 7480a02..bc1fcfd 100644
--- a/crates/shirabe/tests/installer/installation_manager_test.rs
+++ b/crates/shirabe/tests/installer/installation_manager_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Installer/InstallationManagerTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::test_case::get_package;
use shirabe::dependency_resolver::operation::{
InstallOperation, UninstallOperation, UpdateOperation,
};
@@ -16,8 +14,8 @@ use shirabe::util::http_downloader::HttpDownloader;
use shirabe::util::r#loop::Loop;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
-
-use crate::test_case::get_package;
+use std::cell::RefCell;
+use std::rc::Rc;
fn run<F: std::future::Future>(future: F) -> F::Output {
tokio::runtime::Builder::new_current_thread()
diff --git a/crates/shirabe/tests/installer/installer_event_test.rs b/crates/shirabe/tests/installer/installer_event_test.rs
index 8a85cab..b3bf14d 100644
--- a/crates/shirabe/tests/installer/installer_event_test.rs
+++ b/crates/shirabe/tests/installer/installer_event_test.rs
@@ -1,14 +1,13 @@
//! ref: composer/tests/Composer/Test/Installer/InstallerEventTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use shirabe::composer::{ComposerHandle, PartialOrFullComposer};
use shirabe::dependency_resolver::Transaction;
use shirabe::event_dispatcher::EventInterface;
use shirabe::installer::InstallerEvent;
use shirabe::io::IOInterface;
use shirabe::io::null_io::NullIO;
+use std::cell::RefCell;
+use std::rc::Rc;
#[test]
fn test_getter() {
diff --git a/crates/shirabe/tests/installer/library_installer_test.rs b/crates/shirabe/tests/installer/library_installer_test.rs
index b91ec51..44c7e5f 100644
--- a/crates/shirabe/tests/installer/library_installer_test.rs
+++ b/crates/shirabe/tests/installer/library_installer_test.rs
@@ -1,12 +1,7 @@
//! ref: composer/tests/Composer/Test/Installer/LibraryInstallerTest.php
-use std::cell::RefCell;
-use std::fs;
-use std::rc::Rc;
-
+use crate::test_case::get_package;
use indexmap::IndexMap;
-use tempfile::TempDir;
-
use shirabe::composer::{
ComposerHandle, PartialComposerHandle, PartialComposerWeakHandle, PartialOrFullComposer,
};
@@ -21,8 +16,10 @@ use shirabe::repository::RepositoryInterface;
use shirabe::repository::WritableRepositoryInterface;
use shirabe::util::filesystem::Filesystem;
use shirabe_php_shim::PhpMixed;
-
-use crate::test_case::get_package;
+use std::cell::RefCell;
+use std::fs;
+use std::rc::Rc;
+use tempfile::TempDir;
// PHP mocks `Composer\Downloader\DownloadManager` with getMockBuilder and asserts its
// install/update/remove calls; here the equivalent mock is injected into the Composer via
diff --git a/crates/shirabe/tests/installer/metapackage_installer_test.rs b/crates/shirabe/tests/installer/metapackage_installer_test.rs
index 20fe8ea..8528f6a 100644
--- a/crates/shirabe/tests/installer/metapackage_installer_test.rs
+++ b/crates/shirabe/tests/installer/metapackage_installer_test.rs
@@ -3,15 +3,13 @@
//! PHP verifies the mocked repository's add/remove/hasPackage calls; here the same
//! behaviour is checked against a real InstalledArrayRepository by observing its state.
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::test_case::get_package;
use shirabe::installer::{InstallerInterface, MetapackageInstaller};
use shirabe::io::IOInterface;
use shirabe::io::null_io::NullIO;
use shirabe::repository::{InstalledArrayRepository, RepositoryInterface};
-
-use crate::test_case::get_package;
+use std::cell::RefCell;
+use std::rc::Rc;
fn run<F: std::future::Future>(future: F) -> F::Output {
tokio::runtime::Builder::new_current_thread()
diff --git a/crates/shirabe/tests/installer/suggested_packages_reporter_test.rs b/crates/shirabe/tests/installer/suggested_packages_reporter_test.rs
index fa3c8fb..1665085 100644
--- a/crates/shirabe/tests/installer/suggested_packages_reporter_test.rs
+++ b/crates/shirabe/tests/installer/suggested_packages_reporter_test.rs
@@ -1,17 +1,15 @@
//! ref: composer/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::io_mock::{Expectation, IOMock, IOMockGuard, get_io_mock};
+use crate::test_case::get_package;
use indexmap::IndexMap;
use shirabe::installer::SuggestedPackagesReporter;
use shirabe::io::IOInterface;
use shirabe::io::io_interface;
use shirabe::io::null_io::NullIO;
use shirabe::repository::{InstalledRepository, LockArrayRepository, RepositoryInterfaceHandle};
-
-use crate::io_mock::{Expectation, IOMock, IOMockGuard, get_io_mock};
-use crate::test_case::get_package;
+use std::cell::RefCell;
+use std::rc::Rc;
/// ref: SuggestedPackagesReporterTest::setUp.
///
diff --git a/crates/shirabe/tests/package/archiver/archive_manager_test.rs b/crates/shirabe/tests/package/archiver/archive_manager_test.rs
index df83f56..68ee994 100644
--- a/crates/shirabe/tests/package/archiver/archive_manager_test.rs
+++ b/crates/shirabe/tests/package/archiver/archive_manager_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::downloader::DownloadManager;
@@ -14,6 +11,8 @@ use shirabe::package::handle::CompletePackageHandle;
use shirabe::util::http_downloader::HttpDownloader;
use shirabe::util::r#loop::Loop;
use shirabe_php_shim::realpath;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
// ref: ArchiverTestCase::setUp + ArchiveManagerTest::setUp.
diff --git a/crates/shirabe/tests/package/base_package_test.rs b/crates/shirabe/tests/package/base_package_test.rs
index bd29eaa..d1bf432 100644
--- a/crates/shirabe/tests/package/base_package_test.rs
+++ b/crates/shirabe/tests/package/base_package_test.rs
@@ -1,13 +1,12 @@
//! ref: composer/tests/Composer/Test/Package/BasePackageTest.php
+use crate::test_case::get_package;
use shirabe::package::DisplayMode;
use shirabe::package::base_package::package_names_to_regexp;
use shirabe::package::handle::PackageHandle;
use shirabe::repository::{ArrayRepository, RepositoryInterfaceHandle};
use shirabe_semver::VersionParser;
-use crate::test_case::get_package;
-
fn empty_repository() -> RepositoryInterfaceHandle {
RepositoryInterfaceHandle::new(ArrayRepository::new(vec![]).unwrap())
}
diff --git a/crates/shirabe/tests/package/loader/root_package_loader_test.rs b/crates/shirabe/tests/package/loader/root_package_loader_test.rs
index 93ee93a..6a13736 100644
--- a/crates/shirabe/tests/package/loader/root_package_loader_test.rs
+++ b/crates/shirabe/tests/package/loader/root_package_loader_test.rs
@@ -4,9 +4,7 @@
// ProcessExecutor / VersionGuesser or require constraints whose parsing goes through a
// look-around regex the regex crate cannot compile.
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::config::Config;
@@ -23,8 +21,8 @@ use shirabe::util::Git as GitUtil;
use shirabe::util::http_downloader::HttpDownloader;
use shirabe::util::process_executor::{MockExpectation, MockHandler, ProcessExecutor};
use shirabe_php_shim::PhpMixed;
-
-use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
fn null_io() -> Rc<RefCell<dyn IOInterface>> {
Rc::new(RefCell::new(NullIO::new()))
diff --git a/crates/shirabe/tests/package/loader/validating_array_loader_test.rs b/crates/shirabe/tests/package/loader/validating_array_loader_test.rs
index aeafefd..0acf768 100644
--- a/crates/shirabe/tests/package/loader/validating_array_loader_test.rs
+++ b/crates/shirabe/tests/package/loader/validating_array_loader_test.rs
@@ -1,12 +1,11 @@
//! ref: composer/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php
+use crate::test_case;
use indexmap::IndexMap;
use shirabe::package::handle::PackageInterfaceHandle;
use shirabe::package::loader::{InvalidPackageException, LoaderInterface, ValidatingArrayLoader};
use shirabe_php_shim::PhpMixed;
-use crate::test_case;
-
fn s(v: &str) -> PhpMixed {
PhpMixed::String(v.to_string())
}
diff --git a/crates/shirabe/tests/package/locker_test.rs b/crates/shirabe/tests/package/locker_test.rs
index f70b79e..bbc333e 100644
--- a/crates/shirabe/tests/package/locker_test.rs
+++ b/crates/shirabe/tests/package/locker_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/Package/LockerTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::installer::InstallationManager;
@@ -17,6 +14,8 @@ use shirabe::util::http_downloader::HttpDownloader;
use shirabe::util::r#loop::Loop;
use shirabe::util::process_executor::ProcessExecutor;
use shirabe_php_shim::{LogicException, PhpMixed, hash};
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
fn null_io() -> Rc<RefCell<dyn IOInterface>> {
diff --git a/crates/shirabe/tests/package/version/version_guesser_test.rs b/crates/shirabe/tests/package/version/version_guesser_test.rs
index 6bfe6c1..1a3f23c 100644
--- a/crates/shirabe/tests/package/version/version_guesser_test.rs
+++ b/crates/shirabe/tests/package/version/version_guesser_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Package/Version/VersionGuesserTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::config::Config;
@@ -11,8 +9,8 @@ use shirabe::util::Git as GitUtil;
use shirabe::util::platform::Platform;
use shirabe::util::process_executor::{MockExpectation, MockHandler, ProcessExecutor};
use shirabe_php_shim::PhpMixed;
-
-use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
// Mirrors VersionGuesserTest::setUp/tearDown: reset GitUtil's cached `version`
// static so each test re-runs `git --version` against its own mock.
diff --git a/crates/shirabe/tests/package/version/version_selector_test.rs b/crates/shirabe/tests/package/version/version_selector_test.rs
index 8e0912e..3a0c701 100644
--- a/crates/shirabe/tests/package/version/version_selector_test.rs
+++ b/crates/shirabe/tests/package/version/version_selector_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Package/Version/VersionSelectorTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::test_case::get_package;
use indexmap::IndexMap;
use shirabe::filter::platform_requirement_filter::PlatformRequirementFilterFactory;
use shirabe::io::BufferIO;
@@ -17,13 +15,12 @@ use shirabe::package::version::VersionSelector;
use shirabe::package::version::version_parser::VersionParser;
use shirabe::repository::PlatformRepository;
use shirabe::repository::RepositorySetInterface;
+use shirabe_external_packages::symfony::console::output::output_interface;
use shirabe_php_shim::PhpMixed;
use shirabe_php_shim::{PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION};
use shirabe_semver::constraint::AnyConstraint;
-
-use shirabe_external_packages::symfony::console::output::output_interface;
-
-use crate::test_case::get_package;
+use std::cell::RefCell;
+use std::rc::Rc;
mockall::mock! {
RepositorySet {}
diff --git a/crates/shirabe/tests/question/strict_confirmation_question_test.rs b/crates/shirabe/tests/question/strict_confirmation_question_test.rs
index de8911b..d8606eb 100644
--- a/crates/shirabe/tests/question/strict_confirmation_question_test.rs
+++ b/crates/shirabe/tests/question/strict_confirmation_question_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use shirabe::question::StrictConfirmationQuestion;
use shirabe_external_packages::symfony::console::helper::question_helper::QuestionHelper;
use shirabe_external_packages::symfony::console::input::array_input::ArrayInput;
@@ -10,6 +7,8 @@ use shirabe_external_packages::symfony::console::input::streamable_input_interfa
use shirabe_external_packages::symfony::console::output::output_interface::OutputInterface;
use shirabe_external_packages::symfony::console::output::stream_output::StreamOutput;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
const TRUE_ANSWER_REGEX: &str = "/^y(?:es)?$/i";
const FALSE_ANSWER_REGEX: &str = "/^no?$/i";
diff --git a/crates/shirabe/tests/repository/array_repository_test.rs b/crates/shirabe/tests/repository/array_repository_test.rs
index 1612b7c..ae6725d 100644
--- a/crates/shirabe/tests/repository/array_repository_test.rs
+++ b/crates/shirabe/tests/repository/array_repository_test.rs
@@ -1,5 +1,6 @@
//! ref: composer/tests/Composer/Test/Repository/ArrayRepositoryTest.php
+use crate::test_case::{get_alias_package, get_package};
use indexmap::IndexMap;
use shirabe::package::handle::PackageInterfaceHandle;
use shirabe::package::loader::array_loader::ArrayLoader;
@@ -8,8 +9,6 @@ use shirabe::repository::{
};
use shirabe_php_shim::PhpMixed;
-use crate::test_case::{get_alias_package, get_package};
-
/// PHP `setType`/`setAbandoned` operate on non-root packages; the public handle API only allows
/// such setters on root packages, so packages carrying extra config are built via ArrayLoader.
fn loaded(name: &str, version: &str, extra: Vec<(&str, PhpMixed)>) -> PackageInterfaceHandle {
diff --git a/crates/shirabe/tests/repository/artifact_repository_test.rs b/crates/shirabe/tests/repository/artifact_repository_test.rs
index 90e5625..558ee8b 100644
--- a/crates/shirabe/tests/repository/artifact_repository_test.rs
+++ b/crates/shirabe/tests/repository/artifact_repository_test.rs
@@ -1,12 +1,11 @@
//! ref: composer/tests/Composer/Test/Repository/ArtifactRepositoryTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::io::{IOInterface, NullIO};
use shirabe::repository::ArtifactRepository;
use shirabe_php_shim::{PhpMixed, extension_loaded};
+use std::cell::RefCell;
+use std::rc::Rc;
/// Returns true when the test should be skipped because the zip extension is
/// unavailable, mirroring PHP's markTestSkipped in setUp.
diff --git a/crates/shirabe/tests/repository/composer_repository_test.rs b/crates/shirabe/tests/repository/composer_repository_test.rs
index ae82b24..8e5a7f1 100644
--- a/crates/shirabe/tests/repository/composer_repository_test.rs
+++ b/crates/shirabe/tests/repository/composer_repository_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Repository/ComposerRepositoryTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -13,10 +11,10 @@ use shirabe::repository::composer_repository::{ComposerRepository, ProviderListi
use shirabe::util::http_downloader::HttpDownloaderMockHandler;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::constraint::{AnyConstraint, SimpleConstraint};
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
-
// Mirrors PHP's `['url' => .., 'body' => ..]` mock entry (status defaults to 200,
// options match any executed options).
fn http_body(
diff --git a/crates/shirabe/tests/repository/composite_repository_test.rs b/crates/shirabe/tests/repository/composite_repository_test.rs
index eed01f6..5fa0fb8 100644
--- a/crates/shirabe/tests/repository/composite_repository_test.rs
+++ b/crates/shirabe/tests/repository/composite_repository_test.rs
@@ -1,13 +1,12 @@
//! ref: composer/tests/Composer/Test/Repository/CompositeRepositoryTest.php
+use crate::test_case::get_package;
use shirabe::package::handle::PackageInterfaceHandle;
use shirabe::repository::{
ArrayRepository, CompositeRepository, FindPackageConstraint, RepositoryInterface,
RepositoryInterfaceHandle, SEARCH_FULLTEXT,
};
-use crate::test_case::get_package;
-
fn array_repo(packages: Vec<PackageInterfaceHandle>) -> RepositoryInterfaceHandle {
RepositoryInterfaceHandle::new(ArrayRepository::new(packages).unwrap())
}
diff --git a/crates/shirabe/tests/repository/filesystem_repository_test.rs b/crates/shirabe/tests/repository/filesystem_repository_test.rs
index 7459486..e8bdddb 100644
--- a/crates/shirabe/tests/repository/filesystem_repository_test.rs
+++ b/crates/shirabe/tests/repository/filesystem_repository_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Repository/FilesystemRepositoryTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::test_case::{get_alias_package, get_package};
use indexmap::IndexMap;
use shirabe::dependency_resolver::operation::OperationInterface;
use shirabe::installed_versions::InstalledVersions;
@@ -17,8 +15,8 @@ use shirabe::repository::filesystem_repository::FilesystemRepository;
use shirabe::util::filesystem::Filesystem;
use shirabe_php_shim::PhpMixed;
use shirabe_semver::VersionParser;
-
-use crate::test_case::{get_alias_package, get_package};
+use std::cell::RefCell;
+use std::rc::Rc;
/// PHP mocks JsonFile::read()/exists(); without a mocking framework the canned read value is
/// materialized as a real temp file whose decoded JSON reproduces the mock return value exactly.
diff --git a/crates/shirabe/tests/repository/filter_repository_test.rs b/crates/shirabe/tests/repository/filter_repository_test.rs
index a244f52..4a6c112 100644
--- a/crates/shirabe/tests/repository/filter_repository_test.rs
+++ b/crates/shirabe/tests/repository/filter_repository_test.rs
@@ -1,5 +1,6 @@
//! ref: composer/tests/Composer/Test/Repository/FilterRepositoryTest.php
+use crate::test_case::get_package;
use indexmap::IndexMap;
use shirabe::package::base_package::STABILITIES;
use shirabe::repository::{
@@ -8,8 +9,6 @@ use shirabe::repository::{
};
use shirabe_semver::constraint::{AnyConstraint, MatchAllConstraint};
-use crate::test_case::get_package;
-
fn set_up() -> RepositoryInterfaceHandle {
let repo = ArrayRepository::new(vec![
get_package("foo/aaa", "1.0.0"),
diff --git a/crates/shirabe/tests/repository/installed_repository_test.rs b/crates/shirabe/tests/repository/installed_repository_test.rs
index ec56b5f..5aa85e9 100644
--- a/crates/shirabe/tests/repository/installed_repository_test.rs
+++ b/crates/shirabe/tests/repository/installed_repository_test.rs
@@ -1,5 +1,6 @@
//! ref: composer/tests/Composer/Test/Repository/InstalledRepositoryTest.php
+use crate::test_case::get_package;
use indexmap::IndexMap;
use shirabe::package::handle::PackageInterfaceHandle;
use shirabe::package::loader::array_loader::ArrayLoader;
@@ -9,8 +10,6 @@ use shirabe::repository::{
};
use shirabe_php_shim::PhpMixed;
-use crate::test_case::get_package;
-
/// PHP `setReplaces`/`setProvides` operate on non-root packages; the public handle API only allows
/// link setters on root packages, so packages carrying links are built via ArrayLoader.
fn loaded(name: &str, version: &str, extra: Vec<(&str, PhpMixed)>) -> PackageInterfaceHandle {
diff --git a/crates/shirabe/tests/repository/path_repository_test.rs b/crates/shirabe/tests/repository/path_repository_test.rs
index bbf4938..f86d659 100644
--- a/crates/shirabe/tests/repository/path_repository_test.rs
+++ b/crates/shirabe/tests/repository/path_repository_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Repository/PathRepositoryTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::test_case::get_package;
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::{IOInterface, NullIO};
@@ -13,8 +11,8 @@ use shirabe::util::{Platform, ProcessExecutor};
use shirabe_php_shim::{
DIRECTORY_SEPARATOR, PhpMixed, file_get_contents, hash, realpath, serialize,
};
-
-use crate::test_case::get_package;
+use std::cell::RefCell;
+use std::rc::Rc;
fn fixtures_dir() -> String {
format!(
diff --git a/crates/shirabe/tests/repository/repository_factory_test.rs b/crates/shirabe/tests/repository/repository_factory_test.rs
index b1a9001..ef52380 100644
--- a/crates/shirabe/tests/repository/repository_factory_test.rs
+++ b/crates/shirabe/tests/repository/repository_factory_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/Repository/RepositoryFactoryTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -10,6 +7,8 @@ use shirabe::io::null_io::NullIO;
use shirabe::repository::RepositoryFactory;
use shirabe::util::http_downloader::HttpDownloader;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
#[test]
fn test_manager_with_all_repository_types() {
diff --git a/crates/shirabe/tests/repository/repository_manager_test.rs b/crates/shirabe/tests/repository/repository_manager_test.rs
index 732b598..089ce9a 100644
--- a/crates/shirabe/tests/repository/repository_manager_test.rs
+++ b/crates/shirabe/tests/repository/repository_manager_test.rs
@@ -4,9 +4,6 @@
// curl_multi_init, todo!()) with a mocked IO/Config/EventDispatcher and exercise repo
// creation/prepending/wrapping.
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -15,6 +12,8 @@ use shirabe::repository::{ArrayRepository, RepositoryInterfaceHandle, Repository
use shirabe::util::filesystem::Filesystem;
use shirabe::util::http_downloader::HttpDownloader;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
struct SetUp {
diff --git a/crates/shirabe/tests/repository/repository_utils_test.rs b/crates/shirabe/tests/repository/repository_utils_test.rs
index 1c690e9..a53bb37 100644
--- a/crates/shirabe/tests/repository/repository_utils_test.rs
+++ b/crates/shirabe/tests/repository/repository_utils_test.rs
@@ -1,13 +1,12 @@
//! ref: composer/tests/Composer/Test/Repository/RepositoryUtilsTest.php
+use crate::test_case::{get_alias_package, get_package};
use indexmap::IndexMap;
use shirabe::package::handle::PackageInterfaceHandle;
use shirabe::package::loader::array_loader::ArrayLoader;
use shirabe::repository::RepositoryUtils;
use shirabe_php_shim::PhpMixed;
-use crate::test_case::{get_alias_package, get_package};
-
/// PHP `configureLinks` sets link arrays on non-root packages; the public handle API only allows
/// link setters on root packages, so packages carrying links are built via ArrayLoader.
fn load_with(
diff --git a/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs b/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs
index 2e36833..296309f 100644
--- a/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs
@@ -1,8 +1,7 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/ForgejoDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
+use crate::process_executor_mock::{ProcessExecutorMockGuard, get_process_executor_mock};
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -12,11 +11,10 @@ use shirabe::util::filesystem::Filesystem;
use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler};
use shirabe::util::process_executor::MockHandler;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
-use crate::process_executor_mock::{ProcessExecutorMockGuard, get_process_executor_mock};
-
struct SetUp {
home: TempDir,
config: Rc<RefCell<Config>>,
diff --git a/crates/shirabe/tests/repository/vcs/fossil_driver_test.rs b/crates/shirabe/tests/repository/vcs/fossil_driver_test.rs
index a3986c2..1a5a425 100644
--- a/crates/shirabe/tests/repository/vcs/fossil_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/fossil_driver_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -10,6 +7,8 @@ use shirabe::io::null_io::NullIO;
use shirabe::repository::vcs::FossilDriver;
use shirabe::util::filesystem::Filesystem;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
struct SetUp {
diff --git a/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs b/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs
index 5bf3ee4..124d529 100644
--- a/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs
@@ -1,8 +1,7 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
+use crate::io_stub::IOStub;
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -12,11 +11,10 @@ use shirabe::util::filesystem::Filesystem;
use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler};
use shirabe::util::process_executor::ProcessExecutor;
use shirabe_php_shim::{InvalidArgumentException, PhpMixed, RuntimeException};
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
-use crate::io_stub::IOStub;
-
struct SetUp {
home: TempDir,
config: Config,
diff --git a/crates/shirabe/tests/repository/vcs/git_driver_test.rs b/crates/shirabe/tests/repository/vcs/git_driver_test.rs
index 7c30b21..be26dd1 100644
--- a/crates/shirabe/tests/repository/vcs/git_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/git_driver_test.rs
@@ -1,8 +1,8 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/GitDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::{HttpDownloaderMockGuard, get_http_downloader_mock};
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::{ProcessExecutorMockGuard, cmd_full, get_process_executor_mock};
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::config::Config;
@@ -13,12 +13,10 @@ use shirabe::util::http_downloader::HttpDownloaderMockHandler;
use shirabe::util::platform::Platform;
use shirabe::util::process_executor::MockHandler;
use shirabe_php_shim::{PhpMixed, RuntimeException};
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::http_downloader_mock::{HttpDownloaderMockGuard, get_http_downloader_mock};
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::{ProcessExecutorMockGuard, cmd_full, get_process_executor_mock};
-
struct SetUp {
home: TempDir,
config: Config,
diff --git a/crates/shirabe/tests/repository/vcs/github_driver_test.rs b/crates/shirabe/tests/repository/vcs/github_driver_test.rs
index f1084f5..11da393 100644
--- a/crates/shirabe/tests/repository/vcs/github_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/github_driver_test.rs
@@ -1,8 +1,10 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::{
+ ProcessExecutorMockGuard, cmd, cmd_full, get_process_executor_mock,
+};
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::config::ConfigSourceInterface;
@@ -13,14 +15,10 @@ use shirabe::util::filesystem::Filesystem;
use shirabe::util::http_downloader::HttpDownloaderMockHandler;
use shirabe::util::process_executor::{MockHandler, ProcessExecutor};
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::{
- ProcessExecutorMockGuard, cmd, cmd_full, get_process_executor_mock,
-};
-
struct SetUp {
home: TempDir,
config: Config,
diff --git a/crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs b/crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs
index 437617b..f364863 100644
--- a/crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs
@@ -1,8 +1,7 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
+use crate::process_executor_mock::{ProcessExecutorMockGuard, get_process_executor_mock};
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -11,9 +10,8 @@ use shirabe::repository::vcs::GitLabDriver;
use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler};
use shirabe::util::process_executor::{MockHandler, ProcessExecutor};
use shirabe_php_shim::{PhpMixed, extension_loaded};
-
-use crate::http_downloader_mock::{HttpDownloaderMockGuard, expect_full, get_http_downloader_mock};
-use crate::process_executor_mock::{ProcessExecutorMockGuard, get_process_executor_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
// Mirrors GitLabDriverTest::setUp's `gitlab-domains` configuration.
fn make_config() -> Config {
diff --git a/crates/shirabe/tests/repository/vcs/hg_driver_test.rs b/crates/shirabe/tests/repository/vcs/hg_driver_test.rs
index f00cb9d..5e16c67 100644
--- a/crates/shirabe/tests/repository/vcs/hg_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/hg_driver_test.rs
@@ -1,8 +1,8 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/HgDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::{HttpDownloaderMockGuard, get_http_downloader_mock};
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::{ProcessExecutorMockGuard, cmd_full, get_process_executor_mock};
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -12,12 +12,10 @@ use shirabe::util::filesystem::Filesystem;
use shirabe::util::http_downloader::HttpDownloaderMockHandler;
use shirabe::util::process_executor::MockHandler;
use shirabe_php_shim::{PhpMixed, RuntimeException};
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::http_downloader_mock::{HttpDownloaderMockGuard, get_http_downloader_mock};
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::{ProcessExecutorMockGuard, cmd_full, get_process_executor_mock};
-
struct SetUp {
home: TempDir,
config: Config,
diff --git a/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs b/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs
index ef55c75..13b36a3 100644
--- a/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs
@@ -1,8 +1,6 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::process_executor_mock::{ProcessExecutorMockGuard, get_process_executor_mock};
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -12,10 +10,10 @@ use shirabe::util::HttpDownloader;
use shirabe::util::filesystem::Filesystem;
use shirabe::util::process_executor::MockHandler;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::process_executor_mock::{ProcessExecutorMockGuard, get_process_executor_mock};
-
const TEST_URL: &str = "TEST_PERFORCE_URL";
const TEST_DEPOT: &str = "TEST_DEPOT_CONFIG";
const TEST_BRANCH: &str = "TEST_BRANCH_CONFIG";
diff --git a/crates/shirabe/tests/repository/vcs/svn_driver_test.rs b/crates/shirabe/tests/repository/vcs/svn_driver_test.rs
index a1e79fc..70eeead 100644
--- a/crates/shirabe/tests/repository/vcs/svn_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/svn_driver_test.rs
@@ -1,8 +1,8 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::http_downloader_mock::{HttpDownloaderMockGuard, get_http_downloader_mock};
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::{ProcessExecutorMockGuard, cmd_full, get_process_executor_mock};
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -12,12 +12,10 @@ use shirabe::util::filesystem::Filesystem;
use shirabe::util::http_downloader::HttpDownloaderMockHandler;
use shirabe::util::process_executor::MockHandler;
use shirabe_php_shim::{PhpMixed, RuntimeException};
+use std::cell::RefCell;
+use std::rc::Rc;
use tempfile::TempDir;
-use crate::http_downloader_mock::{HttpDownloaderMockGuard, get_http_downloader_mock};
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::{ProcessExecutorMockGuard, cmd_full, get_process_executor_mock};
-
struct SetUp {
home: TempDir,
config: Config,
diff --git a/crates/shirabe/tests/repository/vcs_repository_test.rs b/crates/shirabe/tests/repository/vcs_repository_test.rs
index e3b0e84..ed705e8 100644
--- a/crates/shirabe/tests/repository/vcs_repository_test.rs
+++ b/crates/shirabe/tests/repository/vcs_repository_test.rs
@@ -1,11 +1,6 @@
//! ref: composer/tests/Composer/Test/Repository/VcsRepositoryTest.php
-use std::cell::RefCell;
-use std::collections::HashSet;
-use std::process::Command;
-use std::rc::Rc;
-
-use indexmap::IndexMap;
+use indexmap::{IndexMap, IndexSet};
use serial_test::serial;
use shirabe::config::Config;
use shirabe::io::IOInterface;
@@ -16,6 +11,9 @@ use shirabe::util::filesystem::Filesystem;
use shirabe::util::http_downloader::HttpDownloader;
use shirabe::util::r#loop::Loop;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::process::Command;
+use std::rc::Rc;
use tempfile::TempDir;
struct SetUp {
@@ -175,7 +173,7 @@ fn test_load_versions() {
let composer_home = set_up.composer_home.path().to_path_buf();
let git_repo = set_up.git_repo.path().to_path_buf();
- let mut expected: HashSet<String> = [
+ let mut expected: IndexSet<String> = [
"0.6.0",
"1.0.0",
"1.0.x-dev",
@@ -238,7 +236,11 @@ fn test_load_versions() {
for package in &packages {
let pretty = package.get_pretty_version();
- assert!(expected.remove(&pretty), "Unexpected version {}", pretty);
+ assert!(
+ expected.shift_remove(&pretty),
+ "Unexpected version {}",
+ pretty
+ );
}
assert!(
diff --git a/crates/shirabe/tests/script/event_test.rs b/crates/shirabe/tests/script/event_test.rs
index d143bd2..e249269 100644
--- a/crates/shirabe/tests/script/event_test.rs
+++ b/crates/shirabe/tests/script/event_test.rs
@@ -1,8 +1,5 @@
//! ref: composer/tests/Composer/Test/Script/EventTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::composer::{ComposerHandle, PartialOrFullComposer};
use shirabe::config::Config;
@@ -12,6 +9,8 @@ use shirabe::io::IOInterface;
use shirabe::io::null_io::NullIO;
use shirabe::package::{RootPackageHandle, RootPackageInterfaceHandle};
use shirabe::script::{Event, OriginatingEvent};
+use std::cell::RefCell;
+use std::rc::Rc;
fn create_composer_instance() -> ComposerHandle {
let composer =
diff --git a/crates/shirabe/tests/util/auth_helper_test.rs b/crates/shirabe/tests/util/auth_helper_test.rs
index 7738afb..905cbf7 100644
--- a/crates/shirabe/tests/util/auth_helper_test.rs
+++ b/crates/shirabe/tests/util/auth_helper_test.rs
@@ -1,17 +1,15 @@
//! ref: composer/tests/Composer/Test/Util/AuthHelperTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::io_mock::{Expectation, IOMock, get_io_mock};
use indexmap::IndexMap;
use shirabe::config::ConfigSourceInterface;
use shirabe::io::IOInterface;
use shirabe::io::io_interface;
use shirabe::util::{AuthHelper, Bitbucket, StoreAuth};
use shirabe_php_shim::{PhpMixed, base64_encode, json_encode};
-
-use crate::config_stub::ConfigStubBuilder;
-use crate::io_mock::{Expectation, IOMock, get_io_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
// Mirrors AuthHelperTest::setUp: a DEBUG-verbosity IOMock plus a real Config, both
// shared with the AuthHelper under test. The IOMockGuard runs assert_complete on drop.
diff --git a/crates/shirabe/tests/util/bitbucket_test.rs b/crates/shirabe/tests/util/bitbucket_test.rs
index 2817266..db45b3e 100644
--- a/crates/shirabe/tests/util/bitbucket_test.rs
+++ b/crates/shirabe/tests/util/bitbucket_test.rs
@@ -1,8 +1,9 @@
//! ref: composer/tests/Composer/Test/Util/BitbucketTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
+use crate::io_mock::{Expectation, IOMock, get_io_mock};
+use crate::process_executor_mock::get_process_executor_mock;
use indexmap::IndexMap;
use shirabe::config::{Config, ConfigSourceInterface};
use shirabe::io::IOInterface;
@@ -13,11 +14,8 @@ use shirabe::util::http_downloader::{
};
use shirabe::util::process_executor::MockHandler;
use shirabe_php_shim::{PhpMixed, time};
-
-use crate::config_stub::ConfigStubBuilder;
-use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
-use crate::io_mock::{Expectation, IOMock, get_io_mock};
-use crate::process_executor_mock::get_process_executor_mock;
+use std::cell::RefCell;
+use std::rc::Rc;
const USERNAME: &str = "username";
const PASSWORD: &str = "password";
diff --git a/crates/shirabe/tests/util/config_validator_test.rs b/crates/shirabe/tests/util/config_validator_test.rs
index 94e5792..6d7aaf8 100644
--- a/crates/shirabe/tests/util/config_validator_test.rs
+++ b/crates/shirabe/tests/util/config_validator_test.rs
@@ -1,12 +1,11 @@
//! ref: composer/tests/Composer/Test/Util/ConfigValidatorTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use shirabe::io::io_interface::IOInterface;
use shirabe::io::null_io::NullIO;
use shirabe::package::loader::validating_array_loader::ValidatingArrayLoader;
use shirabe::util::config_validator::ConfigValidator;
+use std::cell::RefCell;
+use std::rc::Rc;
fn fixture(name: &str) -> String {
format!(
diff --git a/crates/shirabe/tests/util/forgejo_test.rs b/crates/shirabe/tests/util/forgejo_test.rs
index a1a8f9c..106cdab 100644
--- a/crates/shirabe/tests/util/forgejo_test.rs
+++ b/crates/shirabe/tests/util/forgejo_test.rs
@@ -1,18 +1,16 @@
//! ref: composer/tests/Composer/Test/Util/ForgejoTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
+use crate::io_mock::{Expectation, IOMock, get_io_mock};
use shirabe::config::{Config, ConfigSourceInterface};
use shirabe::io::IOInterface;
use shirabe::io::io_interface;
use shirabe::util::Forgejo;
use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler};
use shirabe_php_shim::PhpMixed;
-
-use crate::config_stub::ConfigStubBuilder;
-use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
-use crate::io_mock::{Expectation, IOMock, get_io_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
const USERNAME: &str = "username";
const ACCESS_TOKEN: &str = "access-token";
diff --git a/crates/shirabe/tests/util/git_test.rs b/crates/shirabe/tests/util/git_test.rs
index 80037da..43af80a 100644
--- a/crates/shirabe/tests/util/git_test.rs
+++ b/crates/shirabe/tests/util/git_test.rs
@@ -1,8 +1,9 @@
//! ref: composer/tests/Composer/Test/Util/GitTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
use indexmap::IndexMap;
use shirabe::config::{Config, ConfigSourceInterface};
use shirabe::io::IOInterface;
@@ -11,11 +12,8 @@ use shirabe::util::git::Git;
use shirabe::util::http_downloader::HttpDownloaderMockHandler;
use shirabe::util::process_executor::{MockExpectation, MockHandler, ProcessExecutor};
use shirabe_php_shim::{PhpMixed, RuntimeException};
-
-use crate::config_stub::ConfigStubBuilder;
-use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
// No-op ConfigSourceInterface, equivalent to PHPUnit's
// `getMockBuilder(Config::class)` auto-stubbing getConfigSource/getAuthConfigSource:
diff --git a/crates/shirabe/tests/util/github_test.rs b/crates/shirabe/tests/util/github_test.rs
index 0069a9c..b9abeb2 100644
--- a/crates/shirabe/tests/util/github_test.rs
+++ b/crates/shirabe/tests/util/github_test.rs
@@ -1,18 +1,16 @@
//! ref: composer/tests/Composer/Test/Util/GitHubTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
+use crate::io_mock::{Expectation, IOMock, get_io_mock};
use shirabe::config::{Config, ConfigSourceInterface};
use shirabe::io::IOInterface;
use shirabe::io::io_interface;
use shirabe::util::GitHub;
use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler};
use shirabe_php_shim::PhpMixed;
-
-use crate::config_stub::ConfigStubBuilder;
-use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
-use crate::io_mock::{Expectation, IOMock, get_io_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
const PASSWORD: &str = "password";
const MESSAGE: &str = "mymessage";
diff --git a/crates/shirabe/tests/util/gitlab_test.rs b/crates/shirabe/tests/util/gitlab_test.rs
index a3db85b..46c0358 100644
--- a/crates/shirabe/tests/util/gitlab_test.rs
+++ b/crates/shirabe/tests/util/gitlab_test.rs
@@ -1,18 +1,16 @@
//! ref: composer/tests/Composer/Test/Util/GitLabTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
+use crate::io_mock::{Expectation, IOMock, get_io_mock};
use shirabe::config::{Config, ConfigSourceInterface};
use shirabe::io::IOInterface;
use shirabe::io::io_interface;
use shirabe::util::GitLab;
use shirabe::util::http_downloader::HttpDownloaderMockHandler;
use shirabe_php_shim::PhpMixed;
-
-use crate::config_stub::ConfigStubBuilder;
-use crate::http_downloader_mock::{expect_full, get_http_downloader_mock};
-use crate::io_mock::{Expectation, IOMock, get_io_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
const USERNAME: &str = "username";
const PASSWORD: &str = "password";
diff --git a/crates/shirabe/tests/util/http_downloader_test.rs b/crates/shirabe/tests/util/http_downloader_test.rs
index 078fd57..b184184 100644
--- a/crates/shirabe/tests/util/http_downloader_test.rs
+++ b/crates/shirabe/tests/util/http_downloader_test.rs
@@ -1,8 +1,7 @@
//! ref: composer/tests/Composer/Test/Util/HttpDownloaderTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::io_mock::{Expectation, get_io_mock};
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::downloader::TransportException;
@@ -13,9 +12,8 @@ use shirabe::util::Platform;
use shirabe::util::http_downloader::HttpDownloader;
use shirabe_external_packages::symfony::console::output::output_interface::VERBOSITY_NORMAL;
use shirabe_php_shim::{PHP_EOL, PhpMixed};
-
-use crate::config_stub::ConfigStubBuilder;
-use crate::io_mock::{Expectation, get_io_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
// PHP performs a live HTTP get to assert the URL's user:pass is captured via
// setAuthentication. The credential capture happens in `add_job`, before any
diff --git a/crates/shirabe/tests/util/perforce_test.rs b/crates/shirabe/tests/util/perforce_test.rs
index 482094f..b6f8f11 100644
--- a/crates/shirabe/tests/util/perforce_test.rs
+++ b/crates/shirabe/tests/util/perforce_test.rs
@@ -1,8 +1,7 @@
//! ref: composer/tests/Composer/Test/Util/PerforceTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::io_stub::IOStub;
+use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::io::{IOInterface, NullIO};
@@ -10,9 +9,8 @@ use shirabe::util::Perforce;
use shirabe::util::filesystem::Filesystem;
use shirabe::util::process_executor::{MockHandler, ProcessExecutor};
use shirabe_php_shim::PhpMixed;
-
-use crate::io_stub::IOStub;
-use crate::process_executor_mock::{cmd, cmd_full, get_process_executor_mock};
+use std::cell::RefCell;
+use std::rc::Rc;
const TEST_DEPOT: &str = "depot";
const TEST_BRANCH: &str = "branch";
diff --git a/crates/shirabe/tests/util/process_executor_test.rs b/crates/shirabe/tests/util/process_executor_test.rs
index 01e37ed..78c5f9f 100644
--- a/crates/shirabe/tests/util/process_executor_test.rs
+++ b/crates/shirabe/tests/util/process_executor_test.rs
@@ -4,9 +4,6 @@
// password hiding, line splitting and argument escaping; the subprocess execution and mocked
// IO are not ported.
-use std::cell::RefCell;
-use std::rc::Rc;
-
use shirabe::io::ConsoleIO;
use shirabe::io::IOInterface;
use shirabe::io::buffer_io::BufferIO;
@@ -19,6 +16,8 @@ use shirabe_external_packages::symfony::console::output::output_interface::{
OutputInterface, VERBOSITY_DEBUG, VERBOSITY_NORMAL,
};
use shirabe_php_shim::{PHP_EOL, trim};
+use std::cell::RefCell;
+use std::rc::Rc;
#[test]
fn test_execute_captures_output() {
diff --git a/crates/shirabe/tests/util/remote_filesystem_test.rs b/crates/shirabe/tests/util/remote_filesystem_test.rs
index a5d9d66..ba79757 100644
--- a/crates/shirabe/tests/util/remote_filesystem_test.rs
+++ b/crates/shirabe/tests/util/remote_filesystem_test.rs
@@ -1,15 +1,13 @@
//! ref: composer/tests/Composer/Test/Util/RemoteFilesystemTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
+use crate::config_stub::ConfigStubBuilder;
+use crate::io_stub::IOStub;
use indexmap::IndexMap;
use shirabe::io::IOInterface;
use shirabe::util::RemoteFilesystem;
use shirabe_php_shim::{PhpMixed, STREAM_NOTIFY_FILE_SIZE_IS, STREAM_NOTIFY_PROGRESS, strpos};
-
-use crate::config_stub::ConfigStubBuilder;
-use crate::io_stub::IOStub;
+use std::cell::RefCell;
+use std::rc::Rc;
// Mirrors RemoteFilesystemTest::getConfigMock: get('github-domains') and
// get('gitlab-domains') return [], everything else returns null. add_authentication_options
diff --git a/crates/shirabe/tests/util/svn_test.rs b/crates/shirabe/tests/util/svn_test.rs
index 7a30d8b..f700634 100644
--- a/crates/shirabe/tests/util/svn_test.rs
+++ b/crates/shirabe/tests/util/svn_test.rs
@@ -1,14 +1,13 @@
//! ref: composer/tests/Composer/Test/Util/SvnTest.php
-use std::cell::RefCell;
-use std::rc::Rc;
-
use indexmap::IndexMap;
use shirabe::config::Config;
use shirabe::io::IOInterface;
use shirabe::io::null_io::NullIO;
use shirabe::util::svn::Svn;
use shirabe_php_shim::PhpMixed;
+use std::cell::RefCell;
+use std::rc::Rc;
fn map(pairs: Vec<(&str, PhpMixed)>) -> IndexMap<String, PhpMixed> {
pairs.into_iter().map(|(k, v)| (k.to_string(), v)).collect()