aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/repository
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/tests/repository')
-rw-r--r--crates/shirabe/tests/repository/vcs/hg_driver_test.rs49
-rw-r--r--crates/shirabe/tests/repository/vcs/mod.rs1
2 files changed, 50 insertions, 0 deletions
diff --git a/crates/shirabe/tests/repository/vcs/hg_driver_test.rs b/crates/shirabe/tests/repository/vcs/hg_driver_test.rs
index 30be485..d7ff5c3 100644
--- a/crates/shirabe/tests/repository/vcs/hg_driver_test.rs
+++ b/crates/shirabe/tests/repository/vcs/hg_driver_test.rs
@@ -1 +1,50 @@
//! ref: composer/tests/Composer/Test/Repository/Vcs/HgDriverTest.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::HgDriver;
+
+fn supports_data_provider() -> Vec<&'static str> {
+ vec![
+ "ssh://bitbucket.org/user/repo",
+ "ssh://hg@bitbucket.org/user/repo",
+ "ssh://user@bitbucket.org/user/repo",
+ "https://bitbucket.org/user/repo",
+ "https://user@bitbucket.org/user/repo",
+ ]
+}
+
+#[test]
+fn test_supports() {
+ for repository_url in supports_data_provider() {
+ let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new()));
+ let config = Rc::new(RefCell::new(Config::new(true, None)));
+
+ assert!(HgDriver::supports(io, config, repository_url, false).unwrap());
+ }
+}
+
+// The remaining cases construct an HgDriver, which requires an HttpDownloader
+// (curl_multi_init is todo!() in the php-shim) and a mocked ProcessExecutor to feed
+// hg command output, neither of which is available here.
+#[test]
+#[ignore = "needs an HgDriver instance (HttpDownloader reaches curl_multi_init, todo!()) and a mocked ProcessExecutor"]
+fn test_get_branches_filter_invalid_branch_names() {
+ todo!()
+}
+
+#[test]
+#[ignore = "needs an HgDriver instance (HttpDownloader reaches curl_multi_init, todo!()) and a mocked ProcessExecutor"]
+fn test_file_get_content_invalid_identifier() {
+ todo!()
+}
+
+#[test]
+#[ignore = "needs an HgDriver instance (HttpDownloader reaches curl_multi_init, todo!()) and a mocked ProcessExecutor"]
+fn test_get_change_date_invalid_identifier() {
+ todo!()
+}
diff --git a/crates/shirabe/tests/repository/vcs/mod.rs b/crates/shirabe/tests/repository/vcs/mod.rs
index 44958da..474f388 100644
--- a/crates/shirabe/tests/repository/vcs/mod.rs
+++ b/crates/shirabe/tests/repository/vcs/mod.rs
@@ -1 +1,2 @@
mod fossil_driver_test;
+mod hg_driver_test;