if (y < 0 && debug) { message("y is negative") } if (y == 0) { if (x > 0) { log(x) } else { message("x is negative or zero") } } else { y^x } test_that("call1 returns an ordered factor", { expect_s3_class(call1(x, y), c("factor", "ordered")) }) tryCatch( { x <- scan() cat("Total: ", sum(x), "\n", sep = "") }, interrupt = function(e) { message("Aborted by user") } ) while (waiting_for_something()) {}