diff options
| author | tv <tv@krebsco.de> | 2026-12-01 00:52:20 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-12-01 00:52:20 +0000 |
| commit | 30eb9a31ec7e4cf0ef683c86edb28ffc6fa3d54e (patch) | |
| tree | 82a3abb64b8ca02f79a76121d3f3a38c82f4fece /tests | |
| parent | 54f070ef0f905f867a24dece72f667be23f9f843 (diff) | |
enstate: --pack warns of an entry from text with placeholders
Text loses its trailing line breaks, which a key or a certificate rarely
should; a whole-value source (cmd:…, file:…, or a table) takes an entry
byte-exact. The warning says so, and the entry goes in as asked.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/receptor.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/receptor.rs b/tests/receptor.rs index 8bbadf4..56a1666 100644 --- a/tests/receptor.rs +++ b/tests/receptor.rs @@ -435,7 +435,9 @@ fn pack_from_sources() { let path = host.root.join("sources.json"); std::fs::write(&path, list.to_string()).unwrap(); let out = host.root.join("packed"); - enstate::pack::pack(&path, &out, Some(&schema.0)).unwrap(); + let warnings = enstate::pack::pack(&path, &out, Some(&schema.0)).unwrap(); + assert_eq!(warnings.len(), 1, "{warnings:?}"); + assert!(warnings[0].starts_with("item secrets/extra: its source is text with placeholders")); // Byte-exact entries: trailing line breaks stay. assert_eq!( std::fs::read(out.join("channels/secrets/a.key")).unwrap(), |
