context('paren depth tester')
test_that('simple case', {
# given
string = '(a + b)'
# when
result = count_paren_depth(string)
# then
expect_equal(result, 1)
})
test_that('interleaved parentheses', {
# given
string = '(a + (b + c) * (d + (e + f)))'
# when
result = count_paren_depth(string)
# then
expect_equal(result, 3)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.