From 0c6d53ff988d6e33804a7bc277ac5080b7a573cb Mon Sep 17 00:00:00 2001 From: Farooq Karimi Zadeh Date: Tue, 28 May 2024 17:27:02 +0330 Subject: [PATCH] add more test case --- tests/text_to_ast/text_only.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/text_to_ast/text_only.rs b/tests/text_to_ast/text_only.rs index 1866328..d249c59 100644 --- a/tests/text_to_ast/text_only.rs +++ b/tests/text_to_ast/text_only.rs @@ -192,13 +192,29 @@ fn labelled_hashtag() { assert_eq!( parse_only_text(input_bold), vec![ - LaballedTag { - label: vec![Bold(vec![Text(Hello)])], + LabelledTag { + label: vec![Bold(vec![Text("Hello")])], tag: "#hi", }, Text(" ") ] ); + + let input_bold_and_italic = "Hello this is a [_labeled_ **hashtag**](#tag)"; + assert_eq!( + parse_only_text(input_bold_and_italic), + vec![ + Text("Hello this is a "), + LabelledTag { + label: vec![ + Italics(vec![Text("labeled")]), + Text(" "), + Bold(vec![Text("hashtag")]), + ], + tag: "#tag", + } + ] + ); } #[test]