aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-05-18 06:24:50 +0000
committerFuwn <[email protected]>2023-05-18 06:24:50 +0000
commit56f53ddca0135e17708af585bfb50144d6836f55 (patch)
tree1d5beea4c266a7d9bdd50fe4750540d618b0b160 /tests
parentfix: improve macro hygiene (diff)
downloadgerm-56f53ddca0135e17708af585bfb50144d6836f55.tar.xz
germ-56f53ddca0135e17708af585bfb50144d6836f55.zip
fmt: update rustfmt.toml
Diffstat (limited to 'tests')
-rw-r--r--tests/ast.rs43
-rw-r--r--tests/convert.rs8
-rw-r--r--tests/meta.rs14
3 files changed, 19 insertions, 46 deletions
diff --git a/tests/ast.rs b/tests/ast.rs
index 7c6dc36..6d1f545 100644
--- a/tests/ast.rs
+++ b/tests/ast.rs
@@ -51,49 +51,34 @@ That was a link without text."#;
#[test]
fn build_multi_line_list_with_text() {
- assert_eq!(
- *Ast::from_string("* item1\n* 2\nhi text").inner(),
- vec![
- Node::List(vec!["item1".to_string(), "2".to_string()]),
- Node::Text("hi text".to_string()),
- ],
- );
+ assert_eq!(*Ast::from_string("* item1\n* 2\nhi text").inner(), vec![
+ Node::List(vec!["item1".to_string(), "2".to_string()]),
+ Node::Text("hi text".to_string()),
+ ],);
}
#[test]
fn build_multi_line_vec() {
- assert_eq!(
- *Ast::from_string("=> /test hi\nhi there\n> hi").inner(),
- vec![
- Node::Link {
- to: "/test".to_string(),
- text: Some("hi".to_string()),
- },
- Node::Text("hi there".to_string()),
- Node::Blockquote("hi".to_string()),
- ],
- );
+ assert_eq!(*Ast::from_string("=> /test hi\nhi there\n> hi").inner(), vec![
+ Node::Link { to: "/test".to_string(), text: Some("hi".to_string()) },
+ Node::Text("hi there".to_string()),
+ Node::Blockquote("hi".to_string()),
+ ],);
}
#[test]
fn build_single_0th_from_vec() {
- assert_eq!(
- Ast::from_string("=> /test hi").inner(),
- &vec![Node::Link {
- to: "/test".to_string(),
- text: Some("hi".to_string()),
- }],
- );
+ assert_eq!(Ast::from_string("=> /test hi").inner(), &vec![Node::Link {
+ to: "/test".to_string(),
+ text: Some("hi".to_string()),
+ }],);
}
#[test]
fn build_single_element() {
assert_eq!(
Ast::from_string("=> /test hi").inner().get(0).unwrap(),
- &Node::Link {
- to: "/test".to_string(),
- text: Some("hi".to_string()),
- },
+ &Node::Link { to: "/test".to_string(), text: Some("hi".to_string()) },
);
}
diff --git a/tests/convert.rs b/tests/convert.rs
index aad7ac4..afff5bc 100644
--- a/tests/convert.rs
+++ b/tests/convert.rs
@@ -20,8 +20,7 @@
mod test {
use germ::{
convert::{from_string, Target},
- gemini_to_html,
- gemini_to_md,
+ gemini_to_html, gemini_to_md,
};
#[test]
@@ -31,10 +30,7 @@ mod test {
#[test]
fn convert_from_string_to_html_multi_line() {
- assert_eq!(
- from_string("hi\n# hi", &Target::HTML),
- "<p>hi</p><h1>hi</h1>",
- );
+ assert_eq!(from_string("hi\n# hi", &Target::HTML), "<p>hi</p><h1>hi</h1>",);
}
#[test]
diff --git a/tests/meta.rs b/tests/meta.rs
index 70c8adc..7c555de 100644
--- a/tests/meta.rs
+++ b/tests/meta.rs
@@ -47,20 +47,14 @@ mod test {
fn meta_to_string_without_parameters() {
let original_string = "text/gemini";
- assert_eq!(
- Meta::from_string(original_string).to_string(),
- original_string
- );
+ assert_eq!(Meta::from_string(original_string).to_string(), original_string);
}
#[test]
fn meta_to_string_with_parameters() {
let original_string = "text/gemini; hi=2; hi2=string=2";
- assert_eq!(
- Meta::from_string(original_string).to_string(),
- original_string
- );
+ assert_eq!(Meta::from_string(original_string).to_string(), original_string);
}
#[test]
@@ -92,9 +86,7 @@ mod test {
#[test]
fn meta_to_map_length() {
assert_eq!(
- Meta::from_string("text/gemini; hi=2; hi2=string=2")
- .parameters()
- .len(),
+ Meta::from_string("text/gemini; hi=2; hi2=string=2").parameters().len(),
2,
);
}