diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-09 07:29:10 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-09 07:29:10 +0900 |
| commit | f1d65c337c63b6aa3582aabc64bfbbb2f949127c (patch) | |
| tree | 18b0773032d2b8e8ac87372e9dc6b2c8a1c22284 /crates/shirabe/tests/platform | |
| parent | ae19de8597f41c83983e6e6ca35f31d845f16bd3 (diff) | |
| download | php-shirabe-f1d65c337c63b6aa3582aabc64bfbbb2f949127c.tar.gz php-shirabe-f1d65c337c63b6aa3582aabc64bfbbb2f949127c.tar.zst php-shirabe-f1d65c337c63b6aa3582aabc64bfbbb2f949127c.zip | |
test(platform): drop HHVM-only paths from HhvmDetector test
shirabe never runs on HHVM, so the HHVM_VERSION_ID branches are dead.
Dropping them leaves the shim's unimplemented `constant()` without a
caller, so remove it as well.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/platform')
| -rw-r--r-- | crates/shirabe/tests/platform/hhvm_detector_test.rs | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/crates/shirabe/tests/platform/hhvm_detector_test.rs b/crates/shirabe/tests/platform/hhvm_detector_test.rs index f1ec6562..340bf888 100644 --- a/crates/shirabe/tests/platform/hhvm_detector_test.rs +++ b/crates/shirabe/tests/platform/hhvm_detector_test.rs @@ -5,7 +5,7 @@ use shirabe::platform::hhvm_detector::HhvmDetectorInterface; use shirabe::util::Platform; use shirabe::util::ProcessExecutor; use shirabe_external_packages::symfony::process::ExecutableFinder; -use shirabe_php_shim::{PhpMixed, constant, defined}; +use shirabe_php_shim::PhpMixed; use shirabe_semver::VersionParser; fn set_up() -> HhvmDetector { @@ -16,22 +16,12 @@ fn set_up() -> HhvmDetector { #[test] fn test_hhvm_version_when_executing_in_hhvm() { - let mut hhvm_detector = set_up(); - if !defined("HHVM_VERSION_ID") { - // markTestSkipped('Not running with HHVM') - return; - } - let version = hhvm_detector.get_version(); - assert_eq!(version_id_to_version(), version); + // Always succeeds: shirabe never runs on HHVM. } #[test] fn test_hhvm_version_when_executing_in_php() { let mut hhvm_detector = set_up(); - if defined("HHVM_VERSION_ID") { - // markTestSkipped('Running with HHVM') - return; - } if Platform::is_windows() { // markTestSkipped('Test does not run on Windows') return; @@ -68,17 +58,3 @@ fn test_hhvm_version_when_executing_in_php() { VersionParser.normalize(&detected_version, None).unwrap() ); } - -fn version_id_to_version() -> Option<String> { - if !defined("HHVM_VERSION_ID") { - return None; - } - - let hhvm_version_id = constant("HHVM_VERSION_ID").as_int().unwrap(); - Some(format!( - "{}.{}.{}", - hhvm_version_id / 10000, - (hhvm_version_id / 100) % 100, - hhvm_version_id % 100, - )) -} |
