Permalink
Browse files

extensions of "matrix" <-> "array" tests

git-svn-id: https://svn.r-project.org/R/trunk@62410 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
maechler
maechler committed Mar 26, 2013
1 parent 6c46b02 commit 7ba53ee25cd232a15fb50baf0382f9e3e6314fad
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/library/methods/tests/mixinInitialize.R
@@ -69,8 +69,11 @@ setClassUnion("AM", c("array", "matrix")); removeClass("AM")# (ditto)
## as had "matrix" -> "array" -> "matrix" ... recursion
## and we want this to *still* work:
-stopifnot(is(tryCatch(as(array(1:24, 2:4), "matrix"), error=function(e)e),
+stopifnot(is(tryCatch(as(a3 <- array(1:24, 2:4), "matrix"), error=function(e)e),
"error"),
- is(as(array(1:12, 3:4), "matrix"),
- "matrix"))
+ is(as(a2 <- array(1:12, 3:4), "matrix"),
+ "matrix"),
+ is(a2, "matrix"), is(a2, "array"), is(a3, "array"), !is(a3, "matrix"),
+ ## and yes, "for now":
+ identical(a2, matrix(1:12, 3)))

0 comments on commit 7ba53ee

Please sign in to comment.