馃 The Definitive Gemini Protocol Toolkit
gemini gemini-protocol gemtext parser zero-dependency toolkit ast converter html markdown cli networking
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 48 lines 1.2 kB view raw
1#[cfg(test)] 2mod test { 3 use germ::{ 4 convert::{Target, from_string}, 5 gemini_to_html, gemini_to_md, 6 }; 7 8 #[test] 9 fn convert_from_string_to_html_single_line() { 10 assert_eq!(from_string("hi", &Target::HTML), "<p>hi</p>",); 11 } 12 13 #[test] 14 fn convert_from_string_to_html_multi_line() { 15 assert_eq!(from_string("hi\n# hi", &Target::HTML), "<p>hi</p><h1>hi</h1>",); 16 } 17 18 #[test] 19 fn convert_from_string_to_html_single_link_macro_expression() { 20 assert_eq!( 21 gemini_to_html!("=> /to hello !"), 22 "<a href=\"/to\">hello !</a><br>", 23 ); 24 } 25 26 #[test] 27 fn convert_from_string_to_markdown_single_line() { 28 assert_eq!(from_string("hi", &Target::Markdown), "hi\n",); 29 } 30 31 #[test] 32 fn convert_from_string_to_markdown_multi_line() { 33 assert_eq!(from_string("hi\n# hi", &Target::Markdown), "hi\n# hi\n",); 34 } 35 36 #[test] 37 fn convert_from_string_to_markdown_single_link() { 38 assert_eq!( 39 from_string("=> /to hello !", &Target::Markdown), 40 "[hello !](/to)\n", 41 ); 42 } 43 44 #[test] 45 fn convert_from_string_to_markdown_single_macro_expression() { 46 assert_eq!(gemini_to_md!("=> /to hello !"), "[hello !](/to)\n",); 47 } 48}