The unittest package's workhorse function

Group associated unit tests with TAP compliant comments separating the output.

1 |

`message` |
Character vector describing this group. Will be printed as a comment before the tests are ran. |

`tests` |
A code block full of tests. |

Used to group a selection of tests together, for instance you may group the tests relating to a function together.

Returns NULL.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ```
## Not run:
ok_group("Test addition", {
ok(1 + 1 == 2, "Can add 1")
ok(1 + 3 == 4, "Can add 3")
})
ok_group("Test subtraction", {
ok(1 - 1 == 0, "Can subtract 1")
ok(1 - 3 == -2, "Can subtract 3")
})
# # Test addition
# ok - Can add 1
# ok - Can add 3
# # Test subtraction
# ok - Can subtract 1
# ok - Can subtract 3
# Multiline group message
ok_group(c("Test multiplication", "but not division"),{
ok(1 * 1 == 1, "Can multiply by 1")
ok(2 * 3 == 6, "Can multiply by 3")
})
# # Test multiplication
# # but not division
# ok - Can multiply by 1
# ok - Can multiply by 3
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.