()
| 1044 | |
| 1045 | #[test] |
| 1046 | fn test_credit_range_try_extend() { |
| 1047 | let credit = Credit::human("alice", None::<String>, test_hash(), test_timestamp()); |
| 1048 | let mut range = CreditRange::new(10, 15, credit.clone()); |
| 1049 | |
| 1050 | // Should extend with same credit and adjacent line |
| 1051 | assert!(range.try_extend(16, &credit)); |
| 1052 | assert_eq!(range.end_line, 16); |
| 1053 | |
| 1054 | // Should not extend with non-adjacent line |
| 1055 | assert!(!range.try_extend(18, &credit)); |
| 1056 | |
| 1057 | // Should not extend with different credit |
| 1058 | let other = Credit::ai_generated( |
| 1059 | "bob", |
| 1060 | None::<String>, |
| 1061 | AIVendor::Anthropic, |
| 1062 | "claude", |
| 1063 | test_hash(), |
| 1064 | test_timestamp(), |
| 1065 | None, |
| 1066 | ); |
| 1067 | assert!(!range.try_extend(17, &other)); |
| 1068 | } |
| 1069 | |
| 1070 | // FileCredits Tests |
| 1071 |
nothing calls this directly
no test coverage detected