teaql-tool-std 0.1.1

Zero-dependency standard utilities for the TeaQL Tool ecosystem.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use teaql_tool_std::validate::ValidateTool;

#[test]
fn test_validation_operations() {
    let tool = ValidateTool::new();

    assert!(tool.email("test@example.com"));
    assert!(!tool.email("invalid-email"));

    assert!(tool.url("https://google.com"));
    assert!(!tool.url("not-a-url"));

    assert!(tool.min_length("hello", 3));
    assert!(!tool.min_length("hi", 3));

    assert!(tool.max_length("hello", 10));
    assert!(!tool.max_length("hello world", 5));
}