|
1 | 1 | # `arg_match()` has informative error messages
|
2 | 2 |
|
3 | 3 | Code
|
4 |
| - cnd_cat(expect_error(arg_match0("continuuos", c("discrete", "continuous")))) |
| 4 | + (expect_error(arg_match0("continuuos", c("discrete", "continuous")))) |
5 | 5 | Output
|
| 6 | + <error/rlang_error> |
6 | 7 | `"continuuos"` must be one of "discrete" or "continuous".
|
7 | 8 | Did you mean "continuous"?
|
8 | 9 | Code
|
9 |
| - cnd_cat(expect_error(arg_match0("fou", c("bar", "foo")))) |
| 10 | + (expect_error(arg_match0("fou", c("bar", "foo")))) |
10 | 11 | Output
|
| 12 | + <error/rlang_error> |
11 | 13 | `"fou"` must be one of "bar" or "foo".
|
12 | 14 | Did you mean "foo"?
|
13 | 15 | Code
|
14 |
| - cnd_cat(expect_error(arg_match0("fu", c("ba", "fo")))) |
| 16 | + (expect_error(arg_match0("fu", c("ba", "fo")))) |
15 | 17 | Output
|
| 18 | + <error/rlang_error> |
16 | 19 | `"fu"` must be one of "ba" or "fo".
|
17 | 20 | Did you mean "fo"?
|
18 | 21 | Code
|
19 |
| - cnd_cat(expect_error(arg_match0("baq", c("foo", "baz", "bas"), arg_nm = "arg"))) |
| 22 | + (expect_error(arg_match0("baq", c("foo", "baz", "bas"), arg_nm = "arg"))) |
20 | 23 | Output
|
| 24 | + <error/rlang_error> |
21 | 25 | `arg` must be one of "foo", "baz", or "bas".
|
22 | 26 | Did you mean "baz"?
|
23 | 27 | Code
|
24 |
| - cnd_cat(expect_error(arg_match0("", character()))) |
| 28 | + (expect_error(arg_match0("", character()))) |
25 | 29 | Output
|
| 30 | + <error/rlang_error> |
26 | 31 | `values` must have at least one element.
|
27 | 32 |
|
28 | 33 | # `arg_match()` provides no suggestion when the edit distance is too large
|
29 | 34 |
|
30 | 35 | Code
|
31 |
| - cnd_cat(expect_error(arg_match0("foobaz", c("fooquxs", "discrete")))) |
| 36 | + (expect_error(arg_match0("foobaz", c("fooquxs", "discrete")))) |
32 | 37 | Output
|
| 38 | + <error/rlang_error> |
33 | 39 | `"foobaz"` must be one of "fooquxs" or "discrete".
|
34 | 40 | Code
|
35 |
| - cnd_cat(expect_error(arg_match0("a", c("b", "c")))) |
| 41 | + (expect_error(arg_match0("a", c("b", "c")))) |
36 | 42 | Output
|
| 43 | + <error/rlang_error> |
37 | 44 | `"a"` must be one of "b" or "c".
|
38 | 45 |
|
0 commit comments