EVOLUTION-MANAGER
Edit File: expect_deprecated.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Does expression produce lifecycle warnings or errors?</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for expect_deprecated {lifecycle}"><tr><td>expect_deprecated {lifecycle}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Does expression produce lifecycle warnings or errors?</h2> <h3>Description</h3> <p>These functions are equivalent to <code><a href="../../testthat/html/expect_error.html">testthat::expect_warning()</a></code> and <code><a href="../../testthat/html/expect_error.html">testthat::expect_error()</a></code> but check specifically for lifecycle warnings or errors. </p> <p>To test whether a deprecated feature still works without causing a deprecation warning, set the <code>lifecycle_verbosity</code> option to <code>"quiet"</code>. </p> <div class="sourceCode"><pre>test_that("feature still works", { withr::local_options(lifecycle_verbosity = "quiet") expect_true(my_deprecated_function()) }) </pre></div> <h3>Usage</h3> <pre> expect_deprecated(expr, regexp = NULL, ...) expect_defunct(expr) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>expr</code></td> <td> <p>Expression that should produce a lifecycle warning or error.</p> </td></tr> <tr valign="top"><td><code>regexp</code></td> <td> <p>Optional regular expression matched against the expected warning message.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Arguments passed on to <code><a href="../../testthat/html/expect_match.html">expect_match</a></code> </p> <dl> <dt><code>fixed</code></dt><dd><p>If <code>TRUE</code>, treats <code>regexp</code> as a string to be matched exactly (not a regular expressions). Overrides <code>perl</code>.</p> </dd> <dt><code>perl</code></dt><dd><p>logical. Should Perl-compatible regexps be used?</p> </dd> </dl> </td></tr> </table> <h3>Details</h3> <p><code>expect_deprecated()</code> sets the <a href="verbosity.html">lifecycle_verbosity</a> option to <code>"warning"</code> to enforce deprecation warnings which are otherwise only shown once every 8 hours. </p> <hr /><div style="text-align: center;">[Package <em>lifecycle</em> version 1.0.3 <a href="00Index.html">Index</a>]</div> </body></html>