()
| 625 | |
| 626 | #[test] |
| 627 | fn display_messages_include_context() { |
| 628 | // Each variant should surface the data that helps a user diagnose the problem. |
| 629 | let cases: Vec<(PristineError, &[&str])> = vec![ |
| 630 | ( |
| 631 | PristineError::ViewNotFound { |
| 632 | name: "feature-x".into(), |
| 633 | }, |
| 634 | &["view not found", "feature-x"], |
| 635 | ), |
| 636 | ( |
| 637 | PristineError::ViewAlreadyExists { name: "dev".into() }, |
| 638 | &["view already exists", "dev"], |
| 639 | ), |
| 640 | ( |
| 641 | PristineError::CannotDeleteSharedView { |
| 642 | name: "main".into(), |
| 643 | }, |
| 644 | &["cannot delete shared view", "main"], |
| 645 | ), |
| 646 | ( |
| 647 | PristineError::ViewHasChildren { |
| 648 | name: "service-auth".into(), |
| 649 | children: vec!["feature-login".into(), "bug-fix".into()], |
| 650 | }, |
| 651 | &[ |
| 652 | "cannot delete view", |
| 653 | "service-auth", |
| 654 | "feature-login", |
| 655 | "bug-fix", |
| 656 | ], |
| 657 | ), |
| 658 | ( |
| 659 | PristineError::ViewCycleDetected { |
| 660 | name: "a".into(), |
| 661 | parent_name: "b".into(), |
| 662 | }, |
| 663 | &["cannot set parent", "a", "b", "cycle"], |
| 664 | ), |
| 665 | ( |
| 666 | PristineError::BrokenViewParent { |
| 667 | view_id: 3, |
| 668 | view_name: "feature".into(), |
| 669 | parent_id: 99, |
| 670 | }, |
| 671 | &["feature", "3", "missing parent", "99", "repair"], |
| 672 | ), |
| 673 | ( |
| 674 | PristineError::WorkingCopySchemaUnavailable, |
| 675 | &["working-copy storage", "WORKING_COPIES", "write access"], |
| 676 | ), |
| 677 | ( |
| 678 | PristineError::OperationSchemaUnavailable, |
| 679 | &[ |
| 680 | "operation-journal storage", |
| 681 | "OPERATIONS", |
| 682 | "OP_HEADS", |
| 683 | "EFFECT_RECEIPTS", |
| 684 | ], |
nothing calls this directly
no outgoing calls
no test coverage detected