@@ -17,7 +17,7 @@ use syn::{parse::Parse, parse::ParseStream, LitStr};
1717///
1818/// Write Links Notation directly without quotes:
1919///
20- /// ```rust
20+ /// ```rust,ignore
2121/// use links_notation::lino;
2222///
2323/// let result = lino!(papa (lovesMama: loves mama));
@@ -29,7 +29,7 @@ use syn::{parse::Parse, parse::ParseStream, LitStr};
2929///
3030/// Use string literals for complex cases with special characters:
3131///
32- /// ```rust
32+ /// ```rust,ignore
3333/// use links_notation::lino;
3434///
3535/// let result = lino!("papa (lovesMama: loves mama)");
@@ -39,7 +39,7 @@ use syn::{parse::Parse, parse::ParseStream, LitStr};
3939///
4040/// # Examples
4141///
42- /// ```rust
42+ /// ```rust,ignore
4343/// use links_notation::lino;
4444///
4545/// // Direct syntax - cleaner and more native
@@ -333,73 +333,6 @@ fn validate_lino_syntax(input: &str) -> Result<(), String> {
333333 Ok ( ( ) )
334334}
335335
336+ // Unit tests are in a separate file: tests.rs
336337#[ cfg( test) ]
337- mod tests {
338- use super :: * ;
339-
340- #[ test]
341- fn test_validate_balanced_parens ( ) {
342- assert ! ( validate_lino_syntax( "(a b c)" ) . is_ok( ) ) ;
343- assert ! ( validate_lino_syntax( "((a) (b))" ) . is_ok( ) ) ;
344- assert ! ( validate_lino_syntax( "a b c" ) . is_ok( ) ) ;
345- }
346-
347- #[ test]
348- fn test_validate_unbalanced_parens ( ) {
349- assert ! ( validate_lino_syntax( "(a b c" ) . is_err( ) ) ;
350- assert ! ( validate_lino_syntax( "a b c)" ) . is_err( ) ) ;
351- assert ! ( validate_lino_syntax( "((a) (b)" ) . is_err( ) ) ;
352- }
353-
354- #[ test]
355- fn test_validate_quotes ( ) {
356- assert ! ( validate_lino_syntax( r#"("quoted" value)"# ) . is_ok( ) ) ;
357- assert ! ( validate_lino_syntax( "('quoted' value)" ) . is_ok( ) ) ;
358- assert ! ( validate_lino_syntax( r#"("unclosed)"# ) . is_err( ) ) ;
359- assert ! ( validate_lino_syntax( "('unclosed)" ) . is_err( ) ) ;
360- }
361-
362- #[ test]
363- fn test_validate_nested_quotes ( ) {
364- assert ! ( validate_lino_syntax( r#"("string with (parens)" value)"# ) . is_ok( ) ) ;
365- }
366-
367- #[ test]
368- fn test_validate_empty ( ) {
369- assert ! ( validate_lino_syntax( "" ) . is_ok( ) ) ;
370- assert ! ( validate_lino_syntax( " " ) . is_ok( ) ) ;
371- }
372-
373- #[ test]
374- fn test_tokens_to_lino_basic ( ) {
375- // Test basic token conversion
376- let tokens: proc_macro2:: TokenStream = "papa has car" . parse ( ) . unwrap ( ) ;
377- let mut output = String :: new ( ) ;
378- tokens_to_lino_string ( tokens, & mut output) ;
379- assert_eq ! ( output, "papa has car" ) ;
380- }
381-
382- #[ test]
383- fn test_tokens_to_lino_with_parens ( ) {
384- let tokens: proc_macro2:: TokenStream = "papa (loves mama)" . parse ( ) . unwrap ( ) ;
385- let mut output = String :: new ( ) ;
386- tokens_to_lino_string ( tokens, & mut output) ;
387- assert_eq ! ( output, "papa (loves mama)" ) ;
388- }
389-
390- #[ test]
391- fn test_tokens_to_lino_with_colon ( ) {
392- let tokens: proc_macro2:: TokenStream = "(lovesMama: loves mama)" . parse ( ) . unwrap ( ) ;
393- let mut output = String :: new ( ) ;
394- tokens_to_lino_string ( tokens, & mut output) ;
395- assert_eq ! ( output, "(lovesMama: loves mama)" ) ;
396- }
397-
398- #[ test]
399- fn test_tokens_to_lino_nested ( ) {
400- let tokens: proc_macro2:: TokenStream = "(outer (inner value))" . parse ( ) . unwrap ( ) ;
401- let mut output = String :: new ( ) ;
402- tokens_to_lino_string ( tokens, & mut output) ;
403- assert_eq ! ( output, "(outer (inner value))" ) ;
404- }
405- }
338+ mod tests;
0 commit comments