aboutsummaryrefslogtreecommitdiff
path: root/examples/example-argument-picker
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-15 02:22:42 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-15 02:37:21 +0800
commit48cfd06560db6155536f45f3a0209289779a134e (patch)
tree2ec89a31f6f2b01b74dd04def38a58eda6288979 /examples/example-argument-picker
parent1c8ab7c872b67159033a2a7dd42168ee9af50771 (diff)
refactor: move example tests into per-example test.toml files
Replace the centralized `examples/test-examples.toml` with individual `test.toml` files in each example directory, updating the test runner and related documentation accordingly.
Diffstat (limited to 'examples/example-argument-picker')
-rw-r--r--examples/example-argument-picker/test.toml41
1 files changed, 41 insertions, 0 deletions
diff --git a/examples/example-argument-picker/test.toml b/examples/example-argument-picker/test.toml
new file mode 100644
index 0000000..a67ffbe
--- /dev/null
+++ b/examples/example-argument-picker/test.toml
@@ -0,0 +1,41 @@
+[[runs]]
+input = [ "calc", "1", "+", "1" ]
+
+expect.exit-code = 0
+expect.result = "Result: 2"
+
+[[runs]]
+input = [ "calc", "7", "*", "7" ]
+
+expect.exit-code = 0
+expect.result = "Result: 49"
+
+[[runs]]
+input = [ "calc" ]
+
+expect.exit-code = 0
+expect.result = "Error: First number (number_a) was not provided."
+
+[[runs]]
+input = [ "calc", "1" ]
+
+expect.exit-code = 0
+expect.result = "Error: Operator was not provided."
+
+[[runs]]
+input = [ "calc", "1", "+" ]
+
+expect.exit-code = 0
+expect.result = "Error: Second number (number_b) was not provided."
+
+[[runs]]
+input = [ "calc", "4", "/", "3" ]
+
+expect.exit-code = 0
+expect.result = "Result: 1.3333334"
+
+[[runs]]
+input = [ "calc", "4", "/", "3", "--round" ]
+
+expect.exit-code = 0
+expect.result = "Result: 1"