From 8ffc4414e13ed3e81dfc2841149b9a745722fdb1 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 22:40:32 +0000 Subject: enstate: config with placeholders in parentheses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The config crate at continuum's 34434f7 takes $(env:…), $(cmd:…) and $(file:…) as well as ${…}, so a source list may use either. A test packs a $(cmd: …) source. --- tests/receptor.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/receptor.rs b/tests/receptor.rs index 843eaa6..656ed1f 100644 --- a/tests/receptor.rs +++ b/tests/receptor.rs @@ -427,6 +427,9 @@ fn pack_from_sources() { "items": { "a.key": { "source": { "file": "key" } }, "a.pub": { "source": { "command": [lister, "show", "${file:key}"] } }, + // A placeholder in parentheses, as a whole value: text, its trailing line + // breaks removed. + "extra": { "source": format!("$(cmd: {lister} show extra)") }, } }); let path = host.root.join("sources.json"); @@ -442,6 +445,10 @@ fn pack_from_sources() { std::fs::read(out.join("channels/secrets/a.pub")).unwrap(), b"pub-of-K\n\n" ); + assert_eq!( + std::fs::read(out.join("channels/secrets/extra")).unwrap(), + b"pub-of-extra" + ); // The pair validator compares without trailing line breaks ($(cat)). let plan = host.apply(&schema, &out); assert!(plan.accepted, "{plan:?}"); -- cgit v1.3.1