From e735671acb3a81e1b7e334e56b9ef3963ba0c2fc Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 26 Jun 2026 06:08:12 +0800 Subject: feat(core): decouple structured output from Groupped trait Introduce `StructuralData` sealed trait and `pack_structural!` / `group_structural!` / `derive(StructuralData)` macros to control structured rendering separately from grouping. `Groupped` no longer requires `Serialize`. --- examples/test-examples.toml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'examples/test-examples.toml') diff --git a/examples/test-examples.toml b/examples/test-examples.toml index 9c25781..149f2c6 100644 --- a/examples/test-examples.toml +++ b/examples/test-examples.toml @@ -234,16 +234,26 @@ expect.exit-code = 0 expect.result = "Search path not provided" [[test.example-pack-err]] -command = "find --json" +command = "find Cargo.toml" expect.exit-code = 0 -expect.result = '{"name":"error_not_found"}' +expect.result = "Not a directory: Cargo.toml" [[test.example-pack-err]] -command = "find Cargo.toml" +command = "find examples" expect.exit-code = 0 -expect.result = "Not a directory: Cargo.toml" +expect.result = "Found directory: examples" + +[[test.example-pack-err]] +command = "find-structural --json" +expect.exit-code = 0 +expect.result = '{"name":"error_not_found_structural"}' + +[[test.example-pack-err]] +command = "find-structural Cargo.toml --json" +expect.exit-code = 0 +expect.result = '{"name":"error_not_dir_structural","info":"Cargo.toml"}' [[test.example-pack-err]] -command = "find Cargo.toml --json" +command = "find-structural examples --json" expect.exit-code = 0 -expect.result = '{"name":"error_not_dir","info":"Cargo.toml"}' +expect.result = '{"inner":"examples"}' -- cgit