has_message(message('hello'))
has_message(1 + 1)
has_message(message('hello world'), 'hello')
has_warning(1 + 1)
has_warning(1:2 + 1:3)
has_warning(1:2 + 1:3, 'longer object length')
has_error(2 - 3)
has_error(1 + 'a')
has_error(stop('err'), 'err')
has_error(stop('error occurred'), 'error')
Run the code above in your browser using DataLab