-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Matrices inherit from arrays in R-devel.
- Loading branch information
Showing
3 changed files
with
26 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
This is a resubmission that fixes a failure on R-devel. | ||
|
||
--- | ||
|
||
## Test environments | ||
|
||
* local: darwin15.6.0-3.6.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,9 @@ | ||
test_that("format has nice defaults for bare vectors", { | ||
expect_equal( | ||
call_to_format(x <- list(a = 1, b = 2)), | ||
"An object of class \\code{list} of length 2." | ||
) | ||
}) | ||
|
||
test_that("format defaults for S3 objects", { | ||
expect_equal( | ||
call_to_format(x <- ordered(letters[1:5])), | ||
"An object of class \\code{ordered} (inherits from \\code{factor}) of length 5." | ||
) | ||
}) | ||
|
||
test_that("format has nice defaults for matrices and arrays", { | ||
expect_equal( | ||
call_to_format(x <- diag(10)), | ||
"An object of class \\code{matrix} with 10 rows and 10 columns." | ||
) | ||
|
||
expect_equal( | ||
call_to_format(x <- array(1:27, dim = c(3, 3, 3))), | ||
"An object of class \\code{array} of dimension 3 x 3 x 3." | ||
) | ||
}) | ||
|
||
test_that("format has nice defaults for data frames", { | ||
expect_equal( | ||
call_to_format(x <- data.frame(a = 1, b = 2)), | ||
"An object of class \\code{data.frame} with 1 rows and 2 columns." | ||
) | ||
verify_output(test_path("test-object-format.txt"), { | ||
call_to_format(x <- list(a = 1, b = 2)) | ||
call_to_format(x <- ordered(letters[1:5])) | ||
call_to_format(x <- diag(10)) | ||
call_to_format(x <- array(1:27, dim = c(3, 3, 3))) | ||
call_to_format(x <- data.frame(a = 1, b = 2)) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
> call_to_format(x <- list(a = 1, b = 2)) | ||
[1] "An object of class \\code{list} of length 2." | ||
|
||
> call_to_format(x <- ordered(letters[1:5])) | ||
[1] "An object of class \\code{ordered} (inherits from \\code{factor}) of length 5." | ||
|
||
> call_to_format(x <- diag(10)) | ||
[1] "An object of class \\code{matrix} with 10 rows and 10 columns." | ||
|
||
> call_to_format(x <- array(1:27, dim = c(3, 3, 3))) | ||
[1] "An object of class \\code{array} of dimension 3 x 3 x 3." | ||
|
||
> call_to_format(x <- data.frame(a = 1, b = 2)) | ||
[1] "An object of class \\code{data.frame} with 1 rows and 2 columns." | ||
|