# Copyright (C) Brodie Gaslam
#
# This file is part of "vetr - Trust, but Verify"
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# Go to <https://www.r-project.org/Licenses/GPL-2> for a copy of the license.

fun0 <- function(x, y, z) vetr(x = matrix(integer(), ncol = 3), 
    y = integer(2L), z = logical(1L))

For argument `x`, `1` should be "matrix" (is "numeric")

Error in fun0(x = 1, y = 2, z = 3) : 
  For argument `x`, `1` should be "matrix" (is "numeric")

For argument `x`, `matrix(1)` should have 3 columns (has 1)

Error in fun0(x = matrix(1), y = 2, z = 3) : 
  For argument `x`, `matrix(1)` should have 3 columns (has 1)

For argument `y`, `length(2)` should be 2 (is 1)

Error in fun0(x = matrix(1:3, nrow = 1), y = 2, z = 3) : 
  For argument `y`, `length(2)` should be 2 (is 1)

For argument `z`, `3` should be type "logical" (is "double")

Error in fun0(x = matrix(1:3, nrow = 1), y = 2:3, z = 3) : 
  For argument `z`, `3` should be type "logical" (is "double")

Error in fun0(x = matrix(1:3, nrow = 1), y = c(2, 3), z = 3) : 
  For argument `z`, `3` should be type "logical" (is "double")

fun0(matrix(1:3, nrow = 1), c(2, 3), TRUE)

fun1 <- function(x, y, z) vetr(x = matrix(integer(), ncol = 3) || 
    integer(3L), y = integer(2L) || NULL || logical(1L), z = logical(1L))

For argument `y`, `"fail"` should be `NULL`, type "integer-like", or type "logical" (is "character")

Error in fun1(x = 1:3, y = "fail", z = "fail") : 
  For argument `y`, `"fail"` should be `NULL`, type "integer-like", or type "logical" (is "character")

fun1(matrix(1:9, ncol = 3), "fail", "fail")