diff options
| author | Fuwn <[email protected]> | 2025-09-11 05:51:29 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-11 05:51:29 +0000 |
| commit | b45156082cfa08bf7e390d71c4a9c101eb460858 (patch) | |
| tree | 17b204a836cac6ac90c7604d0602253fc95e2f91 /tests | |
| parent | chore: Bump version patch (diff) | |
| download | germ-b45156082cfa08bf7e390d71c4a9c101eb460858.tar.xz germ-b45156082cfa08bf7e390d71c4a9c101eb460858.zip | |
fix(ast): Gracefully handle malformed link lines
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ast.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ast.rs b/tests/ast.rs index 397f752..7a71f5c 100644 --- a/tests/ast.rs +++ b/tests/ast.rs @@ -84,4 +84,18 @@ mod test { "=> / Home" ); } + + #[test] + fn build_malformed_link_without_url() { + let ast = Ast::from_string("=>"); + + assert_eq!(ast.inner().len(), 1); + + if let Node::Link { to, text } = ast.inner().first().unwrap() { + assert_eq!(to, ""); + assert_eq!(text, &None); + } else { + panic!("Expected Link node"); + } + } } |