X-Git-Url: https://git.r.bdr.sh/rbdr/page/blobdiff_plain/1c5797fadeea6be505c01f13508203ba234cbdfa..HEAD:/tests/cli_test.rs diff --git a/tests/cli_test.rs b/tests/cli_test.rs index 0bb46bb..641d6f7 100644 --- a/tests/cli_test.rs +++ b/tests/cli_test.rs @@ -21,25 +21,31 @@ fn test_basic_generation() { let test_dir = setup_test_dir(); let dir_name = test_dir.file_name().unwrap().to_string_lossy(); let parent = test_dir.parent().unwrap(); - let html_dir = parent.join(format!("{}_html", dir_name)); - let gemini_dir = parent.join(format!("{}_gemini", dir_name)); + let html_dir = parent.join(format!("{dir_name}_html")); + let gemini_dir = parent.join(format!("{dir_name}_gemini")); - let _cleanup = TestDir { - paths: vec![test_dir.clone(), html_dir.clone(), gemini_dir.clone()] + let _cleanup = TestDir { + paths: vec![test_dir.clone(), html_dir.clone(), gemini_dir.clone()], }; // Create test input files - create_test_file(&test_dir.join("_layout.html"), "\ + create_test_file( + &test_dir.join("_layout.html"), + "\ {{ title }} {{ content }} -"); - create_test_file(&test_dir.join("test.gmi"), "\ +", + ); + create_test_file( + &test_dir.join("test.gmi"), + "\ --- title: Page Is Cool! # Test Hello world -"); +", + ); create_test_file(&test_dir.join("test.png"), "A picture of a cute cat"); // Run the program from the test directory @@ -54,7 +60,9 @@ Hello world assert!(gemini_dir.exists()); let html_output = html_dir.join("test.html"); - assert_file_contents(&html_output, "\ + assert_file_contents( + &html_output, + "\ Page Is Cool!
@@ -63,16 +71,20 @@ Hello world
-"); +", + ); let html_asset_output = html_dir.join("test.png"); assert_file_contents(&html_asset_output, "A picture of a cute cat"); let gemini_output = gemini_dir.join("test.gmi"); - assert_file_contents(&gemini_output, "\ + assert_file_contents( + &gemini_output, + "\ # Test Hello world -"); +", + ); let gemini_asset_output = gemini_dir.join("test.png"); assert!(gemini_asset_output.exists()); @@ -85,19 +97,22 @@ fn test_missing_layout() { let test_dir = setup_test_dir(); let dir_name = test_dir.file_name().unwrap().to_string_lossy(); let parent = test_dir.parent().unwrap(); - let html_dir = parent.join(format!("{}_html", dir_name)); - let gemini_dir = parent.join(format!("{}_gemini", dir_name)); + let html_dir = parent.join(format!("{dir_name}_html")); + let gemini_dir = parent.join(format!("{dir_name}_gemini")); - let _cleanup = TestDir { - paths: vec![test_dir.clone(), html_dir.clone(), gemini_dir.clone()] + let _cleanup = TestDir { + paths: vec![test_dir.clone(), html_dir.clone(), gemini_dir.clone()], }; // Create test input files - create_test_file(&test_dir.join("test.gmi"), "\ + create_test_file( + &test_dir.join("test.gmi"), + "\ --- title: Page Is Cool! # Test Hello world -"); +", + ); create_test_file(&test_dir.join("test.png"), "A picture of a cute cat"); // Run the program from the test directory