From 84f9508813ac368bdce302db7f3a15bc6fce3fee Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 23 May 2022 08:54:42 +0300 Subject: templates: introduce unit tests These unit tests generate a random MF2-JSON post, convert it to MF2-HTML using the template and then read it back using the `microformats` crate. The only problem is that it has a nasty bug with overstuffing implied properties. This is being worked on: https://gitlab.com/maxburon/microformats-parser/-/issues/7 For now the tests marked as ignored because they fail. But the function itself that generates them should remain here for documentation and potential code sharing with the `microformats` crate, potentially even migrating to a subcrate there. --- templates/Cargo.toml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'templates/Cargo.toml') diff --git a/templates/Cargo.toml b/templates/Cargo.toml index c4c7f46..fe8ac19 100644 --- a/templates/Cargo.toml +++ b/templates/Cargo.toml @@ -5,6 +5,13 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dev-dependencies] +faker_rand = "^0.1.1" +rand = "^0.8.5" +test-logger = "^0.1.0" +[dev-dependencies.microformats] +version="^0.2.0" + [dependencies] ellipse = "^0.2.0" # Truncate and ellipsize strings in a human-friendly way http = "^0.2.7" # Hyper's strong HTTP types -- cgit 1.4.1