# any row sample of iris matches our iris template

`names(iris[c(2, 1, 3, 4, 5)])[1]` should be "Sepal.Length" (is "Sepal.Width")

[1] "`names(iris[c(2, 1, 3, 4, 5)])[1]` should be \"Sepal.Length\" (is \"Sepal.Width\")"

alike(matrix(integer(), 3, 3), matrix(1:9, nrow = 3))

alike(matrix(integer(), 3, 3), matrix(runif(9), nrow = 3))

`matrix(runif(9), nrow = 3)` should be type "integer-like" (is "double")

[1] "`matrix(runif(9), nrow = 3)` should be type \"integer-like\" (is \"double\")"

alike(matrix(integer(), 3), matrix(1:12, nrow = 3))

# partial spec, any 3 row integer matrix

alike(matrix(integer(), 3), matrix(1:12, nrow = 4))

`matrix(1:12, nrow = 4)` should have 3 rows (has 4)

[1] "`matrix(1:12, nrow = 4)` should have 3 rows (has 4)"

alike(matrix(logical()), array(rep(TRUE, 8), rep(2, 3)))

`array(rep(TRUE, 8), rep(2, 3))` should be "matrix" (is "array")

[1] "`array(rep(TRUE, 8), rep(2, 3))` should be \"matrix\" (is \"array\")"

obj.tpl <- structure(TRUE, class = letters[1:3])

# In order for objects to be alike, they must share a family tree, not just
# a common class

obj.cur.1 <- structure(TRUE, class = c("x", letters[1:3]))

obj.cur.2 <- structure(TRUE, class = c(letters[1:3], "x"))

`class(obj.cur.2)[2]` should be "a" (is "b")

# You can compare language objects; these are alike if they are self
# consistent; we don't care what the symbols are, so long as they are used
# consistently across target and current:
# TRUE, symbols are consistent (adding two different symbols)

`quote(a - b)[[1]]` should be a call to `+` (is a call to `-`)

[1] "`quote(a - b)[[1]]` should be a call to `+` (is a call to `-`)"

[1] "`quote(a + a)[[3]]` should not be `a`"

# check for warning, in the future if we properly support RAW then this will
# no longer produce a warning.  Really just looking for a valid STRSXP type.

`alike` behavior for objects of type "raw" is not well defined and may change in the future

Warning in alike(as.raw(integer(3)), as.raw(integer(3))) :
  `alike` behavior for objects of type "raw" is not well defined and may change in the future