docs: explain match assertions and annotation type distinctions

This commit is contained in:
2026-11-15 19:14:55 +08:00
parent 903b3bbf9d
commit 57cd32eb5c
16 changed files with 58 additions and 6 deletions
+2
View File
@@ -291,6 +291,7 @@ fn uri_snapshots_require_a_revision_and_preserve_it_in_source_diagnostics() {
revision: " \t",
bytes: b"1",
};
// 字节有效不能补救缺版本身份,空白版本标签应单独报告 MissingRevision。
assert!(matches!(
EndorReader::from_endor(uri, &missing).unwrap_err().kind,
SourceReadErrorKind::MissingRevision
@@ -336,6 +337,7 @@ fn invalid_uris_do_not_call_the_provider_and_denials_do_not_fall_back_to_files()
"endor:space here",
"endor:bad\nname",
] {
// 每个非法定位符都必须先被基础 URI 校验拒绝,后面的计数零验证未访问宿主。
assert!(matches!(
EndorReader::from_endor(uri, &provider).unwrap_err().kind,
SourceReadErrorKind::InvalidEndorUri