MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_suggestions_not_empty

Function test_suggestions_not_empty

atomic-core/src/crdt/apply/error.rs:958–996  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

956
957 #[test]
958 fn test_suggestions_not_empty() {
959 let trunk_id = TrunkId::new(NodeId::new(1), 0);
960 let branch_id = BranchId::new(NodeId::new(1), 0);
961 let leaf_id = LeafId::new(NodeId::new(1), 0);
962
963 let errors = vec![
964 ApplyError::trunk_not_found(trunk_id),
965 ApplyError::branch_not_found(branch_id),
966 ApplyError::leaf_not_found(leaf_id),
967 ApplyError::path_not_found("test"),
968 ApplyError::trunk_already_exists(trunk_id),
969 ApplyError::branch_already_exists(branch_id),
970 ApplyError::leaf_already_exists(leaf_id),
971 ApplyError::path_already_exists("test", trunk_id),
972 ApplyError::invalid_trunk_state(trunk_id, "s", "o"),
973 ApplyError::invalid_branch_state(branch_id, "s", "o"),
974 ApplyError::invalid_leaf_state(leaf_id, "s", "o"),
975 ApplyError::insertion_position_not_found("d", "a"),
976 ApplyError::circular_reference("d"),
977 ApplyError::ordering_violation("d"),
978 ApplyError::content_out_of_bounds(0, 1, 0),
979 ApplyError::invalid_content("d"),
980 ApplyError::internal("d"),
981 ];
982
983 for err in errors {
984 let suggestion = err.suggestion();
985 assert!(
986 !suggestion.is_empty(),
987 "Suggestion for {} should not be empty",
988 err
989 );
990 assert!(
991 suggestion.len() > 20,
992 "Suggestion for {} should be helpful",
993 err
994 );
995 }
996 }
997
998 // Exit Code Tests
999

Callers

nothing calls this directly

Calls 1

suggestionMethod · 0.45

Tested by

no test coverage detected