aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/repository/artifact_repository_test.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-24 00:47:20 +0900
committernsfisis <nsfisis@gmail.com>2026-06-24 00:47:53 +0900
commit340164c64e90d44b1bdf620b514166db1f76cc98 (patch)
tree86195fe5ff8582b64e0324e9f40619e36c04948f /crates/shirabe/tests/repository/artifact_repository_test.rs
parent8fe3390d064303b86133a1d2983144a4818a7121 (diff)
downloadphp-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.tar.gz
php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.tar.zst
php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.zip
test: port more unimplemented tests
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/repository/artifact_repository_test.rs')
-rw-r--r--crates/shirabe/tests/repository/artifact_repository_test.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/crates/shirabe/tests/repository/artifact_repository_test.rs b/crates/shirabe/tests/repository/artifact_repository_test.rs
index 765bdac..63fd238 100644
--- a/crates/shirabe/tests/repository/artifact_repository_test.rs
+++ b/crates/shirabe/tests/repository/artifact_repository_test.rs
@@ -8,11 +8,14 @@ use shirabe::io::{IOInterface, NullIO};
use shirabe::repository::ArtifactRepository;
use shirabe_php_shim::{PhpMixed, extension_loaded};
-fn set_up() {
+/// Returns true when the test should be skipped because the zip extension is
+/// unavailable, mirroring PHP's markTestSkipped in setUp.
+fn set_up() -> bool {
if !extension_loaded("zip") {
// markTestSkipped('You need the zip extension to run this test.')
- todo!()
+ return true;
}
+ false
}
fn artifacts_dir() -> String {
@@ -34,7 +37,9 @@ fn create_repo(url: &str) -> ArtifactRepository {
#[test]
#[ignore]
fn test_extracts_configs_from_zip_archives() {
- set_up();
+ if set_up() {
+ return;
+ }
let mut expected_packages = vec![
"vendor0/package0-0.0.1".to_string(),
@@ -82,7 +87,9 @@ fn test_extracts_configs_from_zip_archives() {
#[test]
#[ignore]
fn test_absolute_repo_url_creates_absolute_url_packages() {
- set_up();
+ if set_up() {
+ return;
+ }
let absolute_path = artifacts_dir();
let mut repo = create_repo(&absolute_path);
@@ -101,7 +108,9 @@ fn test_absolute_repo_url_creates_absolute_url_packages() {
#[test]
#[ignore]
fn test_relative_repo_url_creates_relative_url_packages() {
- set_up();
+ if set_up() {
+ return;
+ }
let relative_path = "tests/Composer/Test/Repository/Fixtures/artifacts";
let mut repo = create_repo(relative_path);