Expected "produced output of length 10" to throw a warning.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
failure_message <- "`case` (isn't true|is not TRUE|to be TRUE)"
test_outcome = c("success", "fail", "null"),
.test_name = c("success", "fail", "null")
"Cases are correctly evaluated with names added:",
"Patrick doesn't throw inappropriate warnings:",
shouldnt_warn = list(fun = \() 1L + 1L, message = NA),
fun = \() warning("still warn!", call. = FALSE),
test_that("Patrick catches the right class of warning", {
rlang::warn("New warning", class = "testthat_braces_warning")
# Use for checking that line numbers are still correct
stop("code doesn't have srcref", call. = FALSE)
unlist(lapply(results, \(x) x$srcref[1L])) - code_srcref[[1L]][1L]
test_that("patrick reports the correct line numbers", {
with_parameters_test_that("simple", {        # line 2
test_that('patrick gives a deprecation warning for "test_name"', {
test_that("glue-formatted descriptions and test names supported", {
x = list(NULL, 1:10), y = list(NULL, 1:10)
expect_warning("produced output of length 0")
expect_warning("produced output of length 10")
# but fail kindly for potential accidental use of glue
"Attempt to interpret test stub 'a{b}' with glue failed",
# as well as an escape hatch to work around needing ugly escapes
}, .cases = data.frame(d = 1L), .interpret_glue = FALSE)

"`case` (isn't true|is not TRUE|to be TRUE)"
"Cases are correctly evaluated with names added:"
"Patrick doesn't throw inappropriate warnings:"
"Patrick catches the right class of warning"
"patrick reports the correct line numbers"
'patrick gives a deprecation warning for "test_name"'
"glue-formatted descriptions and test names supported"
"Attempt to interpret test stub 'a{b}' with glue failed"

glue-formatted descriptions and test names supported