|
198 | 198 | <error/vctrs_error_subscript_oob> |
199 | 199 | Error: |
200 | 200 | ! Can't subset elements with `"foo"`. |
201 | | - x Element `foo` doesn't exist. |
| 201 | + x Can't find element `foo`. |
202 | 202 | Code |
203 | 203 | (expect_error(vec_as_location2("foo", 1L, names = "bar"), class = "vctrs_error_subscript_oob") |
204 | 204 | ) |
205 | 205 | Output |
206 | 206 | <error/vctrs_error_subscript_oob> |
207 | 207 | Error: |
208 | 208 | ! Can't extract element with `"foo"`. |
209 | | - x Element `foo` doesn't exist. |
| 209 | + x Can't find element `foo`. |
210 | 210 | Code |
211 | 211 | (expect_error(vec_as_location2("foo", 1L, names = "bar", call = call("baz")), |
212 | 212 | class = "vctrs_error_subscript_oob")) |
213 | 213 | Output |
214 | 214 | <error/vctrs_error_subscript_oob> |
215 | 215 | Error in `baz()`: |
216 | 216 | ! Can't extract element with `"foo"`. |
217 | | - x Element `foo` doesn't exist. |
| 217 | + x Can't find element `foo`. |
218 | 218 |
|
219 | 219 | # vec_as_location2() requires length 1 inputs |
220 | 220 |
|
|
897 | 897 | <error/vctrs_error_subscript_oob> |
898 | 898 | Error in `vec_slice()`: |
899 | 899 | ! Can't subset elements with `i`. |
900 | | - x Element `foo` doesn't exist. |
| 900 | + x Can't find element `foo`. |
901 | 901 | Code |
902 | 902 | # With custom `arg` |
903 | 903 | (expect_error(vec_as_location(30, length(letters), arg = "foo", call = call( |
|
915 | 915 | <error/vctrs_error_subscript_oob> |
916 | 916 | Error in `my_function()`: |
917 | 917 | ! Can't subset elements with `foo`. |
918 | | - x Element `foo` doesn't exist. |
| 918 | + x Can't find element `foo`. |
919 | 919 | Code |
920 | 920 | # With tibble columns |
921 | 921 | (expect_error(with_tibble_cols(vec_slice(set_names(letters), "foo")), class = "vctrs_error_subscript_oob") |
|
924 | 924 | <error/vctrs_error_subscript_oob> |
925 | 925 | Error in `vec_slice()`: |
926 | 926 | ! Can't rename columns with `foo(bar)`. |
927 | | - x Column `foo` doesn't exist. |
| 927 | + x Can't find column `foo`. |
928 | 928 | Code |
929 | 929 | (expect_error(with_tibble_cols(vec_slice(set_names(letters), 30)), class = "vctrs_error_subscript_oob") |
930 | 930 | ) |
|
951 | 951 | <error/vctrs_error_subscript_oob> |
952 | 952 | Error in `vec_slice()`: |
953 | 953 | ! Can't remove rows with `foo(bar)`. |
954 | | - x Rows `foo` and `bar` don't exist. |
| 954 | + x Can't find rows `foo` and `bar`. |
955 | 955 | Code |
956 | 956 | (expect_error(with_tibble_rows(vec_slice(set_names(letters), 1:30)), class = "vctrs_error_subscript_oob") |
957 | 957 | ) |
|
980 | 980 | <error/vctrs_error_subscript_oob> |
981 | 981 | Error in `vec_slice()`: |
982 | 982 | ! Can't select columns with `foo(bar)`. |
983 | | - x Columns `foo` and `bar` don't exist. |
| 983 | + x Can't find columns `foo` and `bar`. |
984 | 984 | Code |
985 | 985 | (expect_error(with_tidyselect_select(vec_slice(set_names(letters), 30)), class = "vctrs_error_subscript_oob") |
986 | 986 | ) |
|
1008 | 1008 | <error/vctrs_error_subscript_oob> |
1009 | 1009 | Error in `vec_slice()`: |
1010 | 1010 | ! Can't relocate columns with `foo(bar)`. |
1011 | | - x Columns `foo` and `bar` don't exist. |
| 1011 | + x Can't find columns `foo` and `bar`. |
1012 | 1012 | Code |
1013 | 1013 | (expect_error(with_tidyselect_relocate(vec_slice(set_names(letters), 30)), |
1014 | 1014 | class = "vctrs_error_subscript_oob")) |
|
0 commit comments