diff options
Diffstat (limited to 'examples/test-examples.toml')
| -rw-r--r-- | examples/test-examples.toml | 364 |
1 files changed, 0 insertions, 364 deletions
diff --git a/examples/test-examples.toml b/examples/test-examples.toml deleted file mode 100644 index 03df5e1..0000000 --- a/examples/test-examples.toml +++ /dev/null @@ -1,364 +0,0 @@ -[[test.example-outside-type]] -command = "parse 42" -expect.exit-code = 0 -expect.result = "Parsed number: 42" - -[[test.example-outside-type]] -command = "parse hello" -expect.exit-code = 0 -expect.result = "Parse error: invalid digit found in string" - -[[test.example-outside-type]] -command = "error" -expect.exit-code = 0 -expect.result = "IO_ERROR: Error" - -[[test.example-lazy-resources]] -command = "none" -expect.exit-code = 0 -expect.result = "None" - -[[test.example-lazy-resources]] -command = "show" -expect.exit-code = 0 -expect.result = "Initialized\nbaz: qux\nfoo: bar\nhello: world\nkey: value\nrust: lang" - -[[test.example-basic]] -command = "greet" -expect.exit-code = 0 -expect.result = "Hello, World!" - -[[test.example-basic]] -command = "greet Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice!" - -[[test.example-exitcode]] -command = "hello Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice" - -[[test.example-exitcode]] -command = "hello" -expect.exit-code = 1 -expect.result = "No name provided (with exit code 1)" - -[[test.example-exitcode]] -command = "hello --help" -expect.exit-code = 2 -expect.result = "Usage: hello <NAME>" - -[[test.example-error-handling]] -command = "hello" -expect.exit-code = 0 -expect.result = "No name provided" - -[[test.example-error-handling]] -command = "hello MyBestFriendAlice" -expect.exit-code = 0 -expect.result = "Name too long: 17 > 10" - -[[test.example-error-handling]] -command = "hello Alice" -expect.exit-code = 0 -expect.result = "Name not available" - -[[test.example-error-handling]] -command = "hello Peter" -expect.exit-code = 0 -expect.result = "Hello, Peter" - -[[test.example-error-handling]] -command = "hallo" -expect.exit-code = 0 -expect.result = "Command not found: \"hallo\"" - -[[test.example-argument-parse]] -command = "transfer" -expect.exit-code = 0 -expect.result = "file: (1048576)" - -[[test.example-argument-parse]] -command = "transfer --dir src" -expect.exit-code = 0 -expect.result = "dir: src (1048576)" - -[[test.example-argument-parse]] -command = "transfer --size 500 myfile.txt" -expect.exit-code = 0 -expect.result = "file: myfile.txt (500)" - -[[test.example-argument-parse]] -command = "strict-transfer README.md" -expect.exit-code = 0 -expect.result = "file: README.md (1048576)" - -[[test.example-argument-parse]] -command = "strict-transfer" -expect.exit-code = 0 -expect.result = "Error: name is not provided" - -[[test.example-async-support]] -command = "download readme.txt" -expect.exit-code = 0 -expect.result = "\"readme.txt\" downloaded." - -[[test.example-custom-pickable]] -command = "connect 192.168.1.1:8080" -expect.exit-code = 0 -expect.result = "Connected to \"192.168.1.1:8080\"" - -[[test.example-custom-pickable]] -command = "connect" -expect.exit-code = 0 -expect.result = "Failed to parse address" - -[[test.example-custom-pickable]] -command = "connect invalid" -expect.exit-code = 0 -expect.result = "Failed to parse address" - -[[test.example-dispatch-tree]] -command = "cmd5" -expect.exit-code = 0 -expect.result = "It's works!" - -[[test.example-enum-tag]] -command = "lang-select" -expect.exit-code = 0 -expect.result = "Selected: Rust" - -[[test.example-enum-tag]] -command = "lang-select Python" -expect.exit-code = 0 -expect.result = "Selected: Python" - -[[test.example-enum-tag]] -command = "lang-select OCaml" -expect.exit-code = 0 -expect.result = "Selected: OCaml" - -[[test.example-structural-renderer]] -command = "render Bob 22" -expect.exit-code = 0 -expect.result = "Bob is 22 years old" - -[[test.example-structural-renderer]] -command = "render Bob 22 --json" -expect.exit-code = 0 -expect.result = "{\"member_name\":\"Bob\",\"member_age\":22}" - -[[test.example-help]] -command = "greet" -expect.exit-code = 0 -expect.result = "" - -[[test.example-help]] -command = "greet --help" -expect.exit-code = 0 -expect.result = "Usage: greet <NAME>" - -[[test.example-hook]] -command = "greet" -expect.exit-code = 0 -expect.result = "Hello, World!" - -[[test.example-hook]] -command = "greet Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice!" - -[[test.example-panic-unwind]] -command = "panic" -expect.exit-code = 0 -expect.result = "Program not panic" - -[[test.example-panic-unwind]] -command = "panic something_went_wrong" -expect.exit-code = 0 -expect.result = "Program panic: something_went_wrong" - -[[test.example-resources]] -command = "current" -expect.exit-code = 0 -expect.result = "Current directory:" - -[[test.example-setup]] -command = "1" -expect.exit-code = 0 -expect.result = "" - -[[test.example-setup]] -command = "2" -expect.exit-code = 0 -expect.result = "" - -[[test.example-setup]] -command = "3" -expect.exit-code = 0 -expect.result = "" - -[[test.example-setup]] -command = "4" -expect.exit-code = 0 -expect.result = "" - -[[test.example-setup]] -command = "5" -expect.exit-code = 0 -expect.result = "" - -[[test.example-completion]] -command = "greet World --repeat 1" -expect.exit-code = 0 -expect.result = "Hello, World!" - -[[test.example-clap-binding]] -command = "greet" -expect.exit-code = 0 -expect.result = "Hello, World!" - -[[test.example-clap-binding]] -command = "greet Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice!" - -[[test.example-clap-binding]] -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 Cargo.toml" -expect.exit-code = 0 -expect.result = "Not a directory: Cargo.toml" - -[[test.example-pack-err]] -command = "find examples" -expect.exit-code = 0 -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-structural examples --json" -expect.exit-code = 0 -expect.result = '{"inner":"examples"}' - -[[test.example-pathfinder]] -command = "greet" -expect.exit-code = 0 -expect.result = "Hello, World!" - -[[test.example-pathfinder]] -command = "greet Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice!" - -[[test.example-combine-pathf-dispatch-tree]] -command = "hello Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice!" - -[[test.example-combine-pathf-dispatch-tree]] -command = "hello" -expect.exit-code = 0 -expect.result = "Hello, World!" - -[[test.example-argument-picker]] -command = "calc 1 + 1" -expect.exit-code = 0 -expect.result = "Result: 2" - -[[test.example-argument-picker]] -command = "calc 7 * 7" -expect.exit-code = 0 -expect.result = "Result: 49" - -[[test.example-argument-picker]] -command = "calc" -expect.exit-code = 0 -expect.result = "Error: First number (number_a) was not provided." - -[[test.example-argument-picker]] -command = "calc 1" -expect.exit-code = 0 -expect.result = "Error: Operator was not provided." - -[[test.example-argument-picker]] -command = "calc 1 +" -expect.exit-code = 0 -expect.result = "Error: Second number (number_b) was not provided." - -[[test.example-argument-picker]] -command = "calc 4 / 3" -expect.exit-code = 0 -expect.result = "Result: 1.3333334" - -[[test.example-argument-picker]] -command = "calc 4 / 3 --round" -expect.exit-code = 0 -expect.result = "Result: 1" - -[[test.example-command-macro]] -command = "hello world" -expect.exit-code = 0 -expect.result = "Hello, World" - -[[test.example-command-macro]] -command = "greet-someone Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice" - -[[test.example-command-macro]] -command = "goodbye" -expect.exit-code = 0 -expect.result = "Goodbye!" - -[[test.example-metadata]] -command = "greet" -expect.exit-code = 0 -expect.result = "Hello, World!" - -[[test.example-metadata]] -command = "greet Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice!" - -[[test.example-metadata]] -command = "desc" -expect.exit-code = 0 -expect.result = "EntryGreet desc = ok" - -[[test.example-metadata]] -command = "nodoc" -expect.exit-code = 0 -expect.result = "EntryDescription has no description" - -[[test.example-combine-pathf-metadata]] -command = "hello" -expect.exit-code = 0 -expect.result = "Hello, World!" - -[[test.example-combine-pathf-metadata]] -command = "hello Alice" -expect.exit-code = 0 -expect.result = "Hello, Alice!" - -[[test.example-combine-pathf-metadata]] -command = "desc" -expect.exit-code = 0 -expect.result = "EntryHello desc = okay" |
