aboutsummaryrefslogtreecommitdiff
path: root/examples/test-examples.toml
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-18 22:48:16 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-18 22:48:16 +0800
commit0f7b2a50b05f38d886234ff6b031766c7af1dabb (patch)
tree9c9b5d4aa11c91c117b08e829ec33361c4aa6275 /examples/test-examples.toml
parentdd28430b67dcfda6dd2e91750a4c1a62c085150a (diff)
Add `pack_err!` macro for error structs with automatic name field
Diffstat (limited to 'examples/test-examples.toml')
-rw-r--r--examples/test-examples.toml20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/test-examples.toml b/examples/test-examples.toml
index 8d2cf0d..4a50ab1 100644
--- a/examples/test-examples.toml
+++ b/examples/test-examples.toml
@@ -207,3 +207,23 @@ expect.result = "Hello, Alice!"
command = "greet Alice -r 5"
expect.exit-code = 0
expect.result = "Hello, Alice, Alice, Alice, Alice, Alice!"
+
+[[test.example-pack-err]]
+command = "find"
+expect.exit-code = 0
+expect.result = "Search path not provided"
+
+[[test.example-pack-err]]
+command = "find --json"
+expect.exit-code = 0
+expect.result = '{"name":"error_not_found"}'
+
+[[test.example-pack-err]]
+command = "find Cargo.toml"
+expect.exit-code = 0
+expect.result = "Not a directory: Cargo.toml"
+
+[[test.example-pack-err]]
+command = "find Cargo.toml --json"
+expect.exit-code = 0
+expect.result = '{"name":"error_not_dir","info":"Cargo.toml"}'