aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-21 04:41:01 +0900
committernsfisis <nsfisis@gmail.com>2026-06-21 04:41:01 +0900
commita5b5366492d87ebf3fd0b1aaf77c15dfa978ae95 (patch)
treeaf993f05750537f53b9cbce3457715128599f0ea /crates/shirabe/tests/repository/vcs/perforce_driver_test.rs
parent46ff68a20235cb6ba05d00b001f334abc303eef8 (diff)
downloadphp-shirabe-a5b5366492d87ebf3fd0b1aaf77c15dfa978ae95.tar.gz
php-shirabe-a5b5366492d87ebf3fd0b1aaf77c15dfa978ae95.tar.zst
php-shirabe-a5b5366492d87ebf3fd0b1aaf77c15dfa978ae95.zip
test(repository): port VCS driver tests (Git/GitHub/GitLab/Bitbucket/Svn/Perforce/Forgejo)
Svn/GitBitbucket/Perforce supports pass. GitHub::supports reaches non-strict in_array (todo!()) and Forgejo::supports uses a regex the regex crate cannot compile, so those are ignored. All API-driven cases mock the HttpDownloader (curl) / ProcessExecutor and are stubbed. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/repository/vcs/perforce_driver_test.rs')
-rw-r--r--crates/shirabe/tests/repository/vcs/perforce_driver_test.rs48
1 files changed, 48 insertions, 0 deletions
diff --git a/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs b/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs
index 68e251f..c8353de 100644
--- a/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs
@@ -1 +1,49 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php
+
+use std::cell::RefCell;
+use std::rc::Rc;
+
+use shirabe::config::Config;
+use shirabe::io::IOInterface;
+use shirabe::io::null_io::NullIO;
+use shirabe::repository::vcs::PerforceDriver;
+
+#[test]
+fn test_supports_returns_false_no_deep_check() {
+ let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new()));
+ let config = Rc::new(RefCell::new(Config::new(true, None)));
+
+ assert!(!PerforceDriver::supports(io, config, "existing.url", false).unwrap());
+}
+
+// The remaining cases mock Perforce, the repository config and IO to drive initialization,
+// composer-file detection and cleanup; mocking is not available here.
+#[test]
+#[ignore = "mocks Perforce/repository/IO; mocking is not available"]
+fn test_initialize_captures_variables_from_repo_config() {
+ todo!()
+}
+
+#[test]
+#[ignore = "mocks Perforce/repository/IO; mocking is not available"]
+fn test_initialize_logs_in_and_connects_client() {
+ todo!()
+}
+
+#[test]
+#[ignore = "mocks Perforce/repository/IO; mocking is not available"]
+fn test_has_composer_file_returns_false_on_no_composer_file() {
+ todo!()
+}
+
+#[test]
+#[ignore = "mocks Perforce/repository/IO; mocking is not available"]
+fn test_has_composer_file_returns_true_with_one_or_more_composer_files() {
+ todo!()
+}
+
+#[test]
+#[ignore = "mocks Perforce/repository/IO; mocking is not available"]
+fn test_cleanup() {
+ todo!()
+}