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

Function test_credit_stats_add

atomic-core/src/change/credit.rs:943–964  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

941
942 #[test]
943 fn test_credit_stats_add() {
944 let mut stats = CreditStats::new();
945
946 let human = Credit::human("alice", None::<String>, test_hash(), test_timestamp());
947 stats.add(&human);
948 stats.add(&human);
949
950 let ai = Credit::ai_generated(
951 "bob",
952 None::<String>,
953 AIVendor::Anthropic,
954 "claude",
955 test_hash(),
956 test_timestamp(),
957 None,
958 );
959 stats.add(&ai);
960
961 assert_eq!(stats.total_lines, 3);
962 assert_eq!(stats.human_lines, 2);
963 assert_eq!(stats.ai_generated_lines, 1);
964 }
965
966 #[test]
967 fn test_credit_stats_percentages() {

Callers

nothing calls this directly

Calls 3

test_timestampFunction · 0.85
test_hashFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected