tuls 0.1.0

A compact Rust MCP toolbox for filesystem access, HTTP fetches, persistent memory, local process execution, reusable skills, and provider-backed local subagents.
use super::*;

#[test]
fn short_text_is_returned_unchanged() {
    assert_eq!(truncate_text("hello", 10, "…"), "hello");
    assert_eq!(truncate_text("hello", 5, "…"), "hello");
}

#[test]
fn long_text_including_notice_never_exceeds_limit() {
    let result = truncate_text("hello world", 8, "…");
    assert_eq!(result, "hello…");
    assert!(result.len() <= 8);
}

#[test]
fn multibyte_characters_are_not_split() {
    let result = truncate_text("héllo wörld", 5, "…");
    assert!(result.len() <= 5);
    assert!(result.is_char_boundary(result.len()));
}

#[test]
fn notice_is_bounded_when_it_alone_exceeds_limit() {
    assert_eq!(truncate_text("abcdef", 3, "notice"), "not");
    assert_eq!(truncate_text("abc", 0, "…"), "");
}