diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-21 04:41:01 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-21 04:41:01 +0900 |
| commit | a5b5366492d87ebf3fd0b1aaf77c15dfa978ae95 (patch) | |
| tree | af993f05750537f53b9cbce3457715128599f0ea /crates/shirabe/tests/repository/vcs/svn_driver_test.rs | |
| parent | 46ff68a20235cb6ba05d00b001f334abc303eef8 (diff) | |
| download | php-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/svn_driver_test.rs')
| -rw-r--r-- | crates/shirabe/tests/repository/vcs/svn_driver_test.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/crates/shirabe/tests/repository/vcs/svn_driver_test.rs b/crates/shirabe/tests/repository/vcs/svn_driver_test.rs index ad85dc7..64108c6 100644 --- a/crates/shirabe/tests/repository/vcs/svn_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/svn_driver_test.rs @@ -1 +1,36 @@ //! ref: composer/tests/Composer/Test/Repository/Vcs/SvnDriverTest.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::SvnDriver; + +fn support_provider() -> Vec<(&'static str, bool)> { + vec![ + ("http://svn.apache.org", true), + ("https://svn.sf.net", true), + ("svn://example.org", true), + ("svn+ssh://example.org", true), + ] +} + +#[test] +fn test_support() { + for (url, assertion) in support_provider() { + let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); + let config = Rc::new(RefCell::new(Config::new(true, None))); + + assert_eq!(assertion, SvnDriver::supports(io, config, url, false).unwrap()); + } +} + +// Constructs an SvnDriver and runs an svn command via a mocked ProcessExecutor; mocking is +// not available here. +#[test] +#[ignore = "constructs an SvnDriver and mocks a ProcessExecutor for the svn invocation"] +fn test_wrong_credentials_in_url() { + todo!() +} |
