library(lab3package)
library(testthat)
context("euclidian")
test_that("The code throws an error", {
expect_that(euclidian(c(1000,"a"),c("1000",1000)), throws_error("Error:length of the arguments are not equal to 1 and/or arguments are not numeric"))
expect_that(euclidian(TRUE,c("1000",1000)), throws_error("Error:length of the arguments are not equal to 1 and/or arguments are not numeric"))
expect_that(euclidian(5>2,FALSE), throws_error("Error:length of the arguments are not equal to 1 and/or arguments are not numeric"))
expect_that(euclidian(2,1:10), throws_error("Error:length of the arguments are not equal to 1 and/or arguments are not numeric"))
expect_that(euclidian(1,"hello"), throws_error("Error:length of the arguments are not equal to 1 and/or arguments are not numeric"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.