diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-05-13 19:31:43 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-05-13 19:31:43 +0800 |
| commit | 8b312fc4b4447cfbfde7898ab8f0a1782fcb7aa0 (patch) | |
| tree | 39a403061aadc65ff64ce0032e086c1fd73c1672 /examples/test-examples.toml | |
| parent | 4cd0146979f9191d59e674695030e966f18a16bb (diff) | |
Rename test-examples config file and update reference
Diffstat (limited to 'examples/test-examples.toml')
| -rw-r--r-- | examples/test-examples.toml | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/examples/test-examples.toml b/examples/test-examples.toml new file mode 100644 index 0000000..a63f566 --- /dev/null +++ b/examples/test-examples.toml @@ -0,0 +1,54 @@ +[[test.example-async]] +command = "hello World" +expect.exit-code = 0 +expect.result = "Hello, World!" + +[[test.example-basic]] +command = "hello World" +expect.exit-code = 0 +expect.result = "Hello, World!" + +[[test.example-exit-code]] +command = "error" +expect.exit-code = 1 +expect.result = "Exit with exit code: 1" + +[[test.example-general-renderer]] +command = "render Bob 22" +expect.exit-code = 0 +expect.result = "Bob is 22 years old" + +[[test.example-general-renderer]] +command = "render Bob 22 --json" +expect.exit-code = 0 +expect.result = "{\"member_name\":\"Bob\",\"member_age\":22}" + +[[test.example-general-renderer]] +command = "render Bob 22 --yaml" +expect.exit-code = 0 +expect.result = "member_name: Bob\nmember_age: 22" + +[[test.example-picker]] +command = "pick Bob" +expect.exit-code = 0 +expect.result = "Picked: name = Bob, age = 20" + +[[test.example-picker]] +command = "pick Bob --age -15" +expect.exit-code = 0 +expect.result = "Picked: name = Bob, age = 0" + +[[test.example-picker]] +command = "pick --age 99" +expect.exit-code = 0 +expect.result = "No name provided." + +[[test.example-picker]] +command = "pick" +expect.exit-code = 0 +expect.result = "No name provided." + +[[test.example-picker]] +command = "pick --age 150" +expect.exit-code = 0 +expect.result = "No name provided." |
