diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-19 16:40:58 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-19 17:53:42 +0900 |
| commit | 76e8500cecd7a715b3effc984ae051cdbff2d3d3 (patch) | |
| tree | 644255bf4d40efb45e880952db1cef55a00d59e2 /crates/shirabe/tests/package | |
| parent | 82cd8e8051ef791b9224916a5e2060ad38c1f82b (diff) | |
| download | php-shirabe-76e8500cecd7a715b3effc984ae051cdbff2d3d3.tar.gz php-shirabe-76e8500cecd7a715b3effc984ae051cdbff2d3d3.tar.zst php-shirabe-76e8500cecd7a715b3effc984ae051cdbff2d3d3.zip | |
feat(spdx-licenses): implement is_valid_license_string SPDX expression parser
PHP matches the SPDX license-expression grammar with a single recursive
PCRE pattern ((?(DEFINE) subpatterns plus (?&name) recursion), which the
regex crate cannot express, so port it as a hand-written recursive-descent
parser instead. licenseid/licenseexceptionid dictionary lookups use
longest-match-first, guarded against accepting a short entry that is only
a coincidental prefix of a longer identifier run (e.g. "DOC" prefixing
"DocumentRef-..."), which a length-sorted greedy match alone would
misparse.
Un-ignores the two validating_array_loader tests that were blocked on
this todo!().
Diffstat (limited to 'crates/shirabe/tests/package')
| -rw-r--r-- | crates/shirabe/tests/package/loader/validating_array_loader_test.rs | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/crates/shirabe/tests/package/loader/validating_array_loader_test.rs b/crates/shirabe/tests/package/loader/validating_array_loader_test.rs index 419f703c..07f3e4a6 100644 --- a/crates/shirabe/tests/package/loader/validating_array_loader_test.rs +++ b/crates/shirabe/tests/package/loader/validating_array_loader_test.rs @@ -959,7 +959,6 @@ fn warning_provider() -> Vec<( } /// ref: ValidatingArrayLoaderTest::testLoadWarnings -#[ignore = "license warning cases need the SPDX license-expression grammar (recursive PCRE), not yet ported: spdx_licenses todo!()"] #[test] fn test_load_warnings() { for (cfg, mut expected_warnings, _must_check, _expected_array) in warning_provider() { @@ -981,7 +980,6 @@ fn test_load_warnings() { } /// ref: ValidatingArrayLoaderTest::testLoadSkipsWarningDataWhenIgnoringErrors -#[ignore = "must_check license cases need the SPDX license-expression grammar (recursive PCRE), not yet ported: spdx_licenses todo!()"] #[test] fn test_load_skips_warning_data_when_ignoring_errors() { for (mut cfg, _expected_warnings, must_check, expected_array) in warning_provider() { |
