context("return_type")
test_that("identical return types are simplified", {
x = as_solution_set(list(
"._return_1" = typesys::IntegerType()
, "x_1" = typesys::ComplexType()
, "._return_2" = typesys::IntegerType()
))
result = return_type(x)
# -----
expect_is(result, "typesys::IntegerType")
})
test_that("distinct return types are unioned", {
x = as_solution_set(list(
"._return_1" = typesys::IntegerType()
, "x_1" = typesys::ComplexType()
, "._return_2" = typesys::NumericType()
))
result = return_type(x)
# -----
expect_is(result, "typesys::Union")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.