()
| 319 | |
| 320 | #[test] |
| 321 | fn project_omits_absent_optional_keys() { |
| 322 | let mut input = sample_input("did:atomic:PERSON"); |
| 323 | input.turn_parent = None; |
| 324 | input.agent_vendor = None; |
| 325 | input.started_at = None; |
| 326 | input.ended_at = None; |
| 327 | input.used = Vec::new(); |
| 328 | |
| 329 | let value = project(&input); |
| 330 | let activity = node_of_type(&value, "prov:Activity"); |
| 331 | // Omitted, not null. |
| 332 | assert!(activity.get("turnParent").is_none()); |
| 333 | assert!(activity.get("prov:startedAtTime").is_none()); |
| 334 | assert!(activity.get("prov:endedAtTime").is_none()); |
| 335 | // `used` is omitted when empty (unknown links omitted, never invented). |
| 336 | assert!(activity.get("used").is_none()); |
| 337 | |
| 338 | let agent = node_of_type(&value, "prov:SoftwareAgent"); |
| 339 | assert!(agent.get("vendor").is_none()); |
| 340 | } |
| 341 | |
| 342 | #[test] |
| 343 | fn project_is_deterministic_over_signing_bytes() { |
nothing calls this directly
no test coverage detected