leading_spaces_test/
leading_spaces_test.rs

1use links_notation::parse_lino_to_links;
2
3fn main() {
4    // Example with 2 leading spaces (from issue)
5    let with_leading = "  TELEGRAM_BOT_TOKEN: '849...355:AAG...rgk_YZk...aPU'\n  TELEGRAM_ALLOWED_CHATS:\n    -1002975819706\n    -1002861722681";
6
7    // Example without leading spaces (from issue)
8    let without_leading = "TELEGRAM_BOT_TOKEN: '849...355:AAG...rgk_YZk...aPU'\nTELEGRAM_ALLOWED_CHATS:\n  -1002975819706\n  -1002861722681";
9
10    println!("=== With Leading Spaces (2 spaces at root) ===");
11    match parse_lino_to_links(with_leading) {
12        Ok(links) => {
13            println!("Parsed {} links:", links.len());
14            for (i, link) in links.iter().enumerate() {
15                println!("  Link {}: {:?}", i, link);
16            }
17        }
18        Err(e) => println!("Error: {:?}", e),
19    }
20
21    println!("\n=== Without Leading Spaces (0 spaces at root) ===");
22    match parse_lino_to_links(without_leading) {
23        Ok(links) => {
24            println!("Parsed {} links:", links.len());
25            for (i, link) in links.iter().enumerate() {
26                println!("  Link {}: {:?}", i, link);
27            }
28        }
29        Err(e) => println!("Error: {:?}", e),
30    }
31}