use orgize::Org; #[test] fn emphasis() { insta::assert_snapshot!( Org::parse("*bold*, /italic/,\n_underlined_, =verbatim= and ~code~").to_html(), @r###"

bold, italic, underlined, verbatim and code

"### ); } #[test] fn link() { insta::assert_snapshot!( Org::parse("Visit[[http://example.com][link1]]or[[http://example.com][link1]].").to_html(), @r###"

Visitlink1orlink1.

"### ); } #[test] fn section_and_headline() { insta::assert_snapshot!( Org::parse(r#" * title 1 section 1 ** title 2 section 2 * title 3 section 3 * title 4 section 4 "#).to_html(), @r###"

title 1

section 1

title 2

section 2

title 3

section 3

title 4

section 4

"### ); } #[test] fn list() { insta::assert_snapshot!( Org::parse(r#" + 1 + 2 - 3 - 4 + 5 "#).to_html(), @r###"
"### ); } #[test] fn snippet() { insta::assert_snapshot!( Org::parse("@@html:@@delete this@@html:@@").to_html(), @"

delete this

" ); } #[test] fn paragraphs() { insta::assert_snapshot!( Org::parse(r#" * title paragraph 1 paragraph 2 paragraph 3 paragraph 4 "#).to_html(), @r###"

title

paragraph 1

paragraph 2

paragraph 3

paragraph 4

"### ); } #[test] fn table() { // don't has table header insta::assert_snapshot!( Org::parse(r#" |-----+-----+-----| | 0 | 1 | 2 | | 4 | 5 | 6 | |-----+-----+-----| "#).to_html(), @"
012
456
" ); // has table header insta::assert_snapshot!( Org::parse(r#" | 0 | 1 | 2 | |-----+-----+-----| | 4 | 5 | 6 | |-----+-----+-----| "#).to_html(), @"
012
456
" ); // has two table body insta::assert_snapshot!( Org::parse(r#" | 0 | 1 | 2 | |-----+-----+-----| | 4 | 5 | 6 | |-----+-----+-----| | 7 | 8 | 9 | "#).to_html(), @"
012
456
789
" ); // multiple row rule insta::assert_snapshot!( Org::parse(r#" | 0 | 1 | 2 | |-----+-----+-----| |-----+-----+-----| | 4 | 5 | 6 | "#).to_html(), @"
012
456
" ); // empty insta::assert_snapshot!( Org::parse(r#" |-----+-----+-----| |-----+-----+-----| "#).to_html(), @"
" ); insta::assert_snapshot!( Org::parse(r#" | |- | |- | "#).to_html(), @"
" ); } #[test] fn line_break() { insta::assert_debug_snapshot!( Org::parse("aa\\\\\nbb").to_html(), @r###""

aa
bb

""### ); }