./devel/R-patrick, Parameterized Unit Testing

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 0.3.0, Package name: R-patrick-0.3.0, Maintainer: pkgsrc-users

This is an extension of the 'testthat' package that lets you add
parameters to your unit tests. Parameterized unit tests are often
easier to read and more reliable, since they follow the DNRY (do not
repeat yourself) rule.


Master sites: (Expand)


Version history: (Expand)


CVS history: (Expand)


   2025-02-03 22:48:19 by Makoto Fujiwara | Files touched by this commit (2)
Log message:
(devel/R-patrick) Updated 0.2.0 to 0.3.0, make test passed

# patrick (0.3.0)

*  Patrick can build test names as {glue}-formatted strings, e.g.

    ```r
    with_parameters_test_that(
      "col2hex works for color {color_name}",
      {
        expect_equal(col2hex(color_name), color_hex)
      },
      color_name = c("red", "blue", "black"),
      color_hex = c("#FF0000", "#0000FF", "#000000")
    )
    ```

    This also works for supplying such a formatted string as `.test_name`.

    To disable this behavior, use `.interpret_glue = FALSE`.

    Thanks @chiricom!
   2022-12-18 03:33:53 by Makoto Fujiwara | Files touched by this commit (3)
Log message:
(devel/R-patrick) import R-patrick-0.2.0

This is an extension of the 'testthat' package that lets you add
parameters to your unit tests. Parameterized unit tests are often
easier to read and more reliable, since they follow the DNRY (do not
repeat yourself) rule.