Skip to content
Snippets Groups Projects
Commit bf7a719f authored by Lukas Stadler's avatar Lukas Stadler
Browse files

enable passing tests

parent c4b5640c
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Copyright (c) 2012-2014, Purdue University
* Copyright (c) 2013, 2015, Oracle and/or its affiliates
* Copyright (c) 2013, 2016, Oracle and/or its affiliates
*
* All rights reserved.
*/
......@@ -60,7 +60,7 @@ public class TestBuiltin_deparse extends TestBase {
@Test
public void testdeparse9() {
assertEval(Ignored.Unknown, "argv <- list(quote(utils::str), 60L, TRUE, 69, -1L); .Internal(deparse(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]]))");
assertEval("argv <- list(quote(utils::str), 60L, TRUE, 69, -1L); .Internal(deparse(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]]))");
}
@Test
......
......@@ -84,8 +84,7 @@ public class TestBuiltin_identical extends TestBase {
@Test
public void testidentical14() {
assertEval(Ignored.Unknown,
"argv <- list(structure(c(1, 1, 1, 1, 2, 3), .Dim = c(3L, 2L), .Dimnames = list(NULL, c('I', 'a')), foo = 'bar', class = 'matrix'), structure(c(1, 1, 1, 1, 2, 3), .Dim = c(3L, 2L), class = 'matrix', foo = 'bar', .Dimnames = list(NULL, c('I', 'a'))), TRUE, TRUE, FALSE, TRUE, FALSE); .Internal(identical(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]]))");
assertEval("argv <- list(structure(c(1, 1, 1, 1, 2, 3), .Dim = c(3L, 2L), .Dimnames = list(NULL, c('I', 'a')), foo = 'bar', class = 'matrix'), structure(c(1, 1, 1, 1, 2, 3), .Dim = c(3L, 2L), class = 'matrix', foo = 'bar', .Dimnames = list(NULL, c('I', 'a'))), TRUE, TRUE, FALSE, TRUE, FALSE); .Internal(identical(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]]))");
}
@Test
......@@ -213,8 +212,8 @@ public class TestBuiltin_identical extends TestBase {
assertEval("{ identical(list(1, list(2)), list(list(1), 1)) }");
assertEval("{ identical(list(1, list(2)), list(1, list(2))) }");
assertEval(Ignored.Unknown, "{ x <- 1 ; attr(x, \"my\") <- 10; identical(x, 1) }");
assertEval(Ignored.Unknown, "{ x <- 1 ; attr(x, \"my\") <- 10; y <- 1 ; attr(y, \"my\") <- 11 ; identical(x,y) }");
assertEval("{ x <- 1 ; attr(x, \"my\") <- 10; identical(x, 1) }");
assertEval("{ x <- 1 ; attr(x, \"my\") <- 10; y <- 1 ; attr(y, \"my\") <- 11 ; identical(x,y) }");
assertEval("{ identical(quote(if(x) 42), quote(if(x) 7)) }");
assertEval("{ identical(quote(if(x) 42), quote(if(x) 42)) }");
......
......@@ -4,7 +4,7 @@
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Copyright (c) 2012-2014, Purdue University
* Copyright (c) 2013, 2015, Oracle and/or its affiliates
* Copyright (c) 2013, 2016, Oracle and/or its affiliates
*
* All rights reserved.
*/
......@@ -288,11 +288,7 @@ public class TestSimpleVectors extends TestBase {
assertEval("{ x<-2; x[NULL] }");
assertEval(Output.ContainsError, "{ x<-2; x[[NULL]] }");
assertEval("{ x<-1; x[] }");
// the following reports a different error than GNU R; a fix would require distinguishing
// between using vector access as x[[]] vs. `[[`(x) which is possible but can be tedious
// (and the error message generated by x[[]] makes less sense in this context: invalid
// subscript type 'symbol')
assertEval(Ignored.OutputFormatting, "{ x<-1; x[[]] }");
assertEval("{ x<-1; x[[]] }");
assertEval("{ x<-1:2; dim(x)=c(1,2); x[,] }");
assertEval(Output.ContainsError, "{ x<-1:2; dim(x)=c(1,2); x[[, ]] }");
assertEval("{ x<-1:2; dim(x)=c(1,2); x[,1] }");
......@@ -615,8 +611,7 @@ public class TestSimpleVectors extends TestBase {
assertEval("{ x<-list(aa=1, ba=2); x[[exact=TRUE], \"a\"] }");
assertEval("{ x<-list(ab=1, ac=2); x[[\"a\", exact=FALSE]] }");
// this works but should generate a "coerce to list warning"
assertEval(Ignored.MissingWarning, "{ x<-matrix(1:4, ncol=2, dimnames=list(c(m=\"a\", \"b\"), c(\"c\", \"d\"))); dimnames(x)[[1]]$m<-\"z\"; x }");
assertEval(Output.ContainsWarning, "{ x<-matrix(1:4, ncol=2, dimnames=list(c(m=\"a\", \"b\"), c(\"c\", \"d\"))); dimnames(x)[[1]]$m<-\"z\"; x }");
// this works but matrix printing is off
assertEval(Ignored.MissingWarning, "{ x<-matrix(1:4, ncol=2, dimnames=list(m=c(\"a\", \"b\"), n=c(\"c\", \"d\"))); dimnames(x)$m[1]<-\"z\"; x }");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment