From eaef6c8d00352911e35a157bc83fe87b42414386 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 4 May 2021 12:09:51 +0200 Subject: [PATCH] Revert "temporarily disable broken test" This reverts commit 888d89e2ddd340413f65c155170f844f78b3649f. The code this depends on should now be available. --- src/tools/config.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/tools/config.rs b/src/tools/config.rs index 46e0cd61..499bd187 100644 --- a/src/tools/config.rs +++ b/src/tools/config.rs @@ -149,3 +149,23 @@ fn object_to_writer(output: &mut dyn Write, object: &Object) -> Result<(), Error } Ok(()) } + +#[test] +fn test() { + // let's just reuse some schema we actually have available: + use crate::config::node::NodeConfig; + + const NODE_CONFIG: &str = "\ + acme: account=pebble\n\ + acmedomain0: test1.invalid.local,plugin=power\n\ + acmedomain1: test2.invalid.local\n\ + "; + + let data: NodeConfig = from_str(NODE_CONFIG, &NodeConfig::API_SCHEMA) + .expect("failed to parse simple node config"); + + let config = to_bytes(&data, &NodeConfig::API_SCHEMA) + .expect("failed to serialize node config"); + + assert_eq!(config, NODE_CONFIG.as_bytes()); +}