Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Roms1383 committed Jun 11, 2024
1 parent c81d969 commit 8723b1f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
23 changes: 21 additions & 2 deletions tests/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod rule {
mod start {
use pulldown_cmark::{
Alignment::{self, Center, Left, Right},
CodeBlockKind,
BlockQuoteKind, CodeBlockKind,
Event::*,
HeadingLevel,
LinkType::*,
Expand Down Expand Up @@ -73,7 +73,21 @@ mod start {
}
#[test]
fn blockquote() {
assert_eq!(s(Start(BlockQuote)), "\n > ")
assert_eq!(s(Start(BlockQuote(None))), "\n > ");
assert_eq!(s(Start(BlockQuote(Some(BlockQuoteKind::Note)))), "\n > [!NOTE]\n > ");
assert_eq!(s(Start(BlockQuote(Some(BlockQuoteKind::Tip)))), "\n > [!TIP]\n > ");
assert_eq!(
s(Start(BlockQuote(Some(BlockQuoteKind::Important)))),
"\n > [!IMPORTANT]\n > "
);
assert_eq!(
s(Start(BlockQuote(Some(BlockQuoteKind::Warning)))),
"\n > [!WARNING]\n > "
);
assert_eq!(
s(Start(BlockQuote(Some(BlockQuoteKind::Caution)))),
"\n > [!CAUTION]\n > "
);
}
#[test]
fn codeblock() {
Expand Down Expand Up @@ -297,3 +311,8 @@ fn text() {
fn footnote_reference() {
assert_eq!(s(Event::FootnoteReference("asdf".into())), "[^asdf]")
}
#[test]
fn math() {
assert_eq!(s(Event::InlineMath("x".into())), "$x$");
assert_eq!(s(Event::DisplayMath("x".into())), "$$x$$");
}
2 changes: 1 addition & 1 deletion tests/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ mod blockquote {
#[test]
fn it_pushes_padding_on_quote_start() {
assert_eq!(
fmte(&[Event::Start(Tag::BlockQuote),]).1,
fmte(&[Event::Start(Tag::BlockQuote(None)),]).1,
State {
newlines_before_start: 1,
padding: vec![" > ".into()],
Expand Down

0 comments on commit 8723b1f

Please sign in to comment.