MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / test_token_estimate

Function test_token_estimate

crates/opencode-util/src/util.rs:299–304  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297
298 #[test]
299 fn test_token_estimate() {
300 assert_eq!(token::estimate(""), 0);
301 assert_eq!(token::estimate("hello"), 1);
302 assert_eq!(token::estimate("hello world"), 2);
303 assert_eq!(token::estimate("a".repeat(100).as_str()), 25);
304 }
305
306 #[test]
307 fn test_format_duration() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected