diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test index ccd9eeddbc0af5c9bf5aed5e90d5f6868209e458..9ea0c0786e02a067d10401a4f3bbf19696c55aef 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test @@ -48492,6 +48492,10 @@ character(0) [1,] 7 [2,] 9 +##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatch +#{ match("a", factor(c("a", "b", "a"))) } +[1] 1 + ##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatch #{ match("abc", c("xyz")) } [1] NA @@ -48550,6 +48554,10 @@ character(0) #{ match(factor(c("a", "b")), factor(c("c", "b", "a", "b", "c", "a"))) } [1] 3 2 +##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatch +#{ match(factor(c("a", "b", "a")), "a") } +[1] 1 NA 1 + ##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatchCall #{ f <- function() match.call() ; f() } f() @@ -48598,6 +48606,44 @@ f(x = 2) #{ f <- function(x) match.call() ; f(x=2) } f(x = 2) +##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatchCall +#{ f1<-function(...) { dots <- match.call(expand.dots = FALSE)$...; dots }; f2<-function(...) f1(...); f2("a") } +[[1]] +[1] "a" + + +##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatchCall +#{ f1<-function(...) { dots <- match.call(expand.dots = FALSE)$...; dots }; f2<-function(...) f1(...); f2(c("a")) } +[[1]] +..1 + + +##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatchCall +#{ f1<-function(...) { dots <- match.call(expand.dots = FALSE)$...; dots }; f2<-function(...) f1(...); f2(c("a"), "b") } +[[1]] +..1 + +[[2]] +[1] "b" + + +##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatchCall +#{ f1<-function(...) { dots <- match.call(expand.dots = FALSE)$...; dots }; f2<-function(...) f1(...); f2(c("a"), c("b")) } +[[1]] +..1 + +[[2]] +..2 + + +##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatchCall +#{ f1<-function(...) { dots <- match.call(expand.dots = FALSE)$...; dots }; f2<-function(...) f1(...); typeof(f2("a")[[1]]) } +[1] "character" + +##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatchCall +#{ f1<-function(...) { dots <- match.call(expand.dots = FALSE)$...; dots }; f2<-function(...) f1(...); typeof(f2(c("a"))[[1]]) } +[1] "symbol" + ##com.oracle.truffle.r.test.library.base.TestSimpleBuiltins.testMatchFun #{ f <- function(x) { y <- match.fun(x) ; y(3,4) } ; c(f("+"),f("*")) } [1] 7 12