knitr::opts_chunk$set(
  error = TRUE,
  collapse = TRUE,
  comment = "#>",
  out.width = "100%"
)
library(testthat)
library(matrixR)
context("Test IsSquareMatrix.")
test_that("TRUE.", {
  expect_true(
    IsSquareMatrix(matrix(1:9, ncol = 3))
  )
  # yac_symbol
  expect_true(
    IsSquareMatrix(Ryacas::ysym(matrix(1:9, ncol = 3)))
  )
})
test_that("FALSE.", {
  expect_false(
    IsSquareMatrix(matrix(1:10, ncol = 2))
  )
  # yac_symbol
  expect_false(
    IsSquareMatrix(Ryacas::ysym(matrix(1:10, ncol = 2)))
  )
  # to cover OTHERWISE
  expect_false(
    IsSquareMatrix(1:5)
  )
})


jeksterslab/matrixR documentation built on Feb. 22, 2021, 8:10 a.m.