From 8fe026f11a3f5da3261209f7b7fc1331d2cdb8c0 Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Wed, 3 Apr 2024 11:07:12 -0400 Subject: [PATCH] added test --- src/vault/parsing.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/vault/parsing.rs b/src/vault/parsing.rs index 52112c34..35acc484 100644 --- a/src/vault/parsing.rs +++ b/src/vault/parsing.rs @@ -204,4 +204,40 @@ fj aklfjd assert_eq!(parsed, expected) } + + #[test] + fn test_short_code_block_parsing_multiple() { + + + let test = r" fjdlf jdlk `test code block` jfkl `dlk` j"; + + let parsed = MDCodeBlock::new(test).collect_vec(); + + let expected = vec![MDCodeBlock{ + range: Range { + start: Position { + line: 0, + character: 13 + }, + end: Position { + line: 0, + character: 30 + } + }.into() + }, MDCodeBlock{ + range: Range { + start: Position { + line: 0, + character: 36 + }, + end: Position { + line: 0, + character: 41 + } + }.into() + }]; + + assert_eq!(parsed, expected) + + } }