From 58e1a201202e21a0d1a2393f367fcb96d29370e6 Mon Sep 17 00:00:00 2001 From: Lukas Stadler <lukas.stadler@oracle.com> Date: Wed, 10 Feb 2016 15:46:34 +0100 Subject: [PATCH] add toupper/tolower tests, enable passing tests --- .../truffle/r/test/ExpectedTestOutput.test | 18 ++++++++++++++++++ .../r/test/builtins/TestBuiltin_attr.java | 5 ++--- .../test/builtins/TestBuiltin_attributes.java | 3 +-- .../r/test/builtins/TestBuiltin_structure.java | 8 ++++---- .../r/test/builtins/TestBuiltin_tolower.java | 16 ++++++++++------ .../r/test/builtins/TestBuiltin_toupper.java | 10 +++++----- .../library/base/TestSimpleAttributes.java | 1 + .../r/test/rpackages/TestVanillaPackage.java | 12 ++---------- 8 files changed, 43 insertions(+), 30 deletions(-) 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 4a68fb8594..b34ed25ea9 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 @@ -45984,6 +45984,18 @@ Volume 55.4 55.7 58.3 51.5 51 77.0 Time differences in mins [1] 6.666667 1366.500000 +##com.oracle.truffle.r.test.builtins.TestBuiltin_tolower.testCharUtils +#tolower(NA_integer_) +[1] NA + +##com.oracle.truffle.r.test.builtins.TestBuiltin_tolower.testCharUtils +#tolower(NA_real_) +[1] NA + +##com.oracle.truffle.r.test.builtins.TestBuiltin_tolower.testCharUtils +#tolower(c('NA', 'na')) +[1] "na" "na" + ##com.oracle.truffle.r.test.builtins.TestBuiltin_tolower.testCharUtils #{ tolower(1E100) } [1] "1e+100" @@ -56616,6 +56628,12 @@ attr(,"a") [1,] FALSE TRUE [2,] FALSE FALSE +##com.oracle.truffle.r.test.library.base.TestSimpleAttributes.testBuiltinPropagation +#{ x <- "a" ; attr(x, "myatt") <- 1; tolower(x) } +[1] "a" +attr(,"myatt") +[1] 1 + ##com.oracle.truffle.r.test.library.base.TestSimpleAttributes.testBuiltinPropagation #{ x <- "a" ; attr(x, "myatt") <- 1; toupper(x) } [1] "A" diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_attr.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_attr.java index ea4133c588..d844a29318 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_attr.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_attr.java @@ -4,7 +4,7 @@ * http://www.gnu.org/licenses/gpl-2.0.html * * Copyright (c) 2014, Purdue University - * Copyright (c) 2014, 2015, Oracle and/or its affiliates + * Copyright (c) 2014, 2016, Oracle and/or its affiliates * * All rights reserved. */ @@ -96,8 +96,7 @@ public class TestBuiltin_attr extends TestBase { @Test public void testattr17() { - assertEval(Ignored.Unknown, - "argv <- list(structure(c(0.5, 0.5, 0.5, 0.5), gradient = structure(c(NaN, NaN, NaN, NaN), .Dim = c(4L, 1L), .Dimnames = list(NULL, 'L75'))), 'gradient');attr(argv[[1]],argv[[2]]);"); + assertEval("argv <- list(structure(c(0.5, 0.5, 0.5, 0.5), gradient = structure(c(NaN, NaN, NaN, NaN), .Dim = c(4L, 1L), .Dimnames = list(NULL, 'L75'))), 'gradient');attr(argv[[1]],argv[[2]]);"); } @Test diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_attributes.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_attributes.java index 12f5a1c06a..566c20e83d 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_attributes.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_attributes.java @@ -101,8 +101,7 @@ public class TestBuiltin_attributes extends TestBase { @Test public void testattributes17() { - assertEval(Ignored.Unknown, - "argv <- list(structure(list(L = structure(c('Min. :14.00 ', '1st Qu.:26.00 ', 'Median :29.50 ', 'Mean :36.39 ', '3rd Qu.:49.25 ', 'Max. :70.00 ', 'A:9 ', 'B:9 ', NA, NA, NA, NA), .Dim = c(6L, 2L), .Dimnames = list(c('', '', '', '', '', ''), c(' breaks', 'wool')), class = 'table'), M = structure(c('Min. :12.00 ', '1st Qu.:18.25 ', 'Median :27.00 ', 'Mean :26.39 ', '3rd Qu.:33.75 ', 'Max. :42.00 ', 'A:9 ', 'B:9 ', NA, NA, NA, NA), .Dim = c(6L, 2L), .Dimnames = list(c('', '', '', '', '', ''), c(' breaks', 'wool')), class = 'table'), H = structure(c('Min. :10.00 ', '1st Qu.:15.25 ', 'Median :20.50 ', 'Mean :21.67 ', '3rd Qu.:25.50 ', 'Max. :43.00 ', 'A:9 ', 'B:9 ', NA, NA, NA, NA), .Dim = c(6L, 2L), .Dimnames = list(c('', '', '', '', '', ''), c(' breaks', 'wool')), class = 'table')), .Dim = 3L, .Dimnames = structure(list(`warpbreaks[, 'tension']` = c('L', 'M', 'H')), .Names = 'warpbreaks[, \\\'tension\\\']')));attributes(argv[[1]]);"); + assertEval("argv <- list(structure(list(L = structure(c('Min. :14.00 ', '1st Qu.:26.00 ', 'Median :29.50 ', 'Mean :36.39 ', '3rd Qu.:49.25 ', 'Max. :70.00 ', 'A:9 ', 'B:9 ', NA, NA, NA, NA), .Dim = c(6L, 2L), .Dimnames = list(c('', '', '', '', '', ''), c(' breaks', 'wool')), class = 'table'), M = structure(c('Min. :12.00 ', '1st Qu.:18.25 ', 'Median :27.00 ', 'Mean :26.39 ', '3rd Qu.:33.75 ', 'Max. :42.00 ', 'A:9 ', 'B:9 ', NA, NA, NA, NA), .Dim = c(6L, 2L), .Dimnames = list(c('', '', '', '', '', ''), c(' breaks', 'wool')), class = 'table'), H = structure(c('Min. :10.00 ', '1st Qu.:15.25 ', 'Median :20.50 ', 'Mean :21.67 ', '3rd Qu.:25.50 ', 'Max. :43.00 ', 'A:9 ', 'B:9 ', NA, NA, NA, NA), .Dim = c(6L, 2L), .Dimnames = list(c('', '', '', '', '', ''), c(' breaks', 'wool')), class = 'table')), .Dim = 3L, .Dimnames = structure(list(`warpbreaks[, 'tension']` = c('L', 'M', 'H')), .Names = 'warpbreaks[, \\\'tension\\\']')));attributes(argv[[1]]);"); } @Test diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_structure.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_structure.java index f6298c2a1b..a7655b84be 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_structure.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_structure.java @@ -4,7 +4,7 @@ * http://www.gnu.org/licenses/gpl-2.0.html * * Copyright (c) 2014, Purdue University - * Copyright (c) 2014, 2015, Oracle and/or its affiliates + * Copyright (c) 2014, 2016, Oracle and/or its affiliates * * All rights reserved. */ @@ -20,9 +20,9 @@ public class TestBuiltin_structure extends TestBase { @Test public void teststructure1() { - assertEval(Ignored.Unknown, - "argv <- structure(list(.Data = structure(c(1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L,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 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L), .Label = c('13', '14', '15', '16', '17'), class = 'factor'), .Label = c('13', '14', '15', '16', '17'), class = 'factor'), .Names = c('.Data', '.Label', 'class'));" - + "do.call('structure', argv)"); + assertEval( + "argv <- structure(list(.Data = structure(c(1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 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4L, 5L), .Label = c('13', '14', '15', '16', '17'), class = 'factor'), .Label = c('13', '14', '15', '16', '17'), class = 'factor'), .Names = c('.Data', '.Label', 'class'));" + + "do.call('structure', argv)"); } } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_tolower.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_tolower.java index ddf455ad18..f925907db4 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_tolower.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_tolower.java @@ -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. */ @@ -39,7 +39,7 @@ public class TestBuiltin_tolower extends TestBase { @Test public void testtolower5() { - assertEval(Ignored.Unknown, "argv <- list(structure('base', .Names = 'Priority')); .Internal(tolower(argv[[1]]))"); + assertEval(Ignored.Unimplemented, "argv <- list(structure('base', .Names = 'Priority')); .Internal(tolower(argv[[1]]))"); } @Test @@ -49,7 +49,7 @@ public class TestBuiltin_tolower extends TestBase { @Test public void testtolower8() { - assertEval(Ignored.Unknown, "argv <- structure(list(x = c('NA', NA, 'BANANA')), .Names = 'x');do.call('tolower', argv)"); + assertEval("argv <- structure(list(x = c('NA', NA, 'BANANA')), .Names = 'x');do.call('tolower', argv)"); } @Test @@ -57,8 +57,12 @@ public class TestBuiltin_tolower extends TestBase { assertEval("{ tolower(c(\"Hello\",\"ByE\")) }"); assertEval("{ tolower(c()) }"); - assertEval(Ignored.Unknown, "{ tolower(1E100) }"); - assertEval(Ignored.Unknown, "{ tolower(c(a=\"HI\", \"HELlo\")) }"); - assertEval(Ignored.Unknown, "{ tolower(NA) }"); + assertEval(Ignored.OutputFormatting, "{ tolower(1E100) }"); + assertEval(Ignored.Unimplemented, "{ tolower(c(a=\"HI\", \"HELlo\")) }"); + assertEval("{ tolower(NA) }"); + + assertEval("tolower(c('NA', 'na'))"); + assertEval("tolower(NA_integer_)"); + assertEval("tolower(NA_real_)"); } } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_toupper.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_toupper.java index 32a4e74e27..b6c876986f 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_toupper.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_toupper.java @@ -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. */ @@ -34,7 +34,7 @@ public class TestBuiltin_toupper extends TestBase { @Test public void testtoupper4() { - assertEval(Ignored.Unknown, + assertEval(Ignored.Unimplemented, "argv <- list(structure(c('BasicClasses', 'Classes', 'Documentation', 'environment-class', 'GenericFunctions', 'language-class', 'LinearMethodsList-class', 'MethodDefinition-class', 'MethodWithNext-class', 'Methods', 'MethodsList-class', 'callNextMethod', 'ObjectsWithPackage-class', 'S3Part', 'S4groupGeneric', 'SClassExtension-class', 'StructureClasses', 'TraceClasses', 'as', 'callGeneric', 'canCoerce', 'cbind2', 'className', 'classRepresentation-class', 'classesToAM', 'dotsMethods', 'evalSource', 'findClass', 'findMethods', 'fixPre1.8', 'genericFunction-class', 'getClass', 'getMethod', 'getPackageName', 'hasArg', 'implicitGeneric', 'inheritedSlotNames', 'initialize-methods', 'is', 'isSealedMethod', 'LocalReferenceClasses', 'method.skeleton', 'new', 'nonStructure-class', 'promptClass', 'promptMethods', 'ReferenceClasses', 'representation', 'selectSuperClasses', 'setClass', 'setClassUnion', 'setGeneric', 'setLoadActions', 'setMethod', 'setOldClass', 'makeClassRepresentation', 'show', 'showMethods', 'signature-class', 'slot', 'envRefClass-class', 'testInheritedMethods', 'validObject', '.BasicFunsList'), .Names = c('/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/BasicClasses.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/Classes.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/Documentation.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/EnvironmentClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/GenericFunctions.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/LanguageClasses.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/LinearMethodsList-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/MethodDefinition-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/MethodWithNext-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/Methods.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/MethodsList-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/NextMethod.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/ObjectsWithPackage-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/S3Part.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/S4groupGeneric.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/SClassExtension-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/StructureClasses.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/TraceClasses.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/as.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/callGeneric.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/canCoerce.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/cbind2.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/className.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/classRepresentation-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/classesToAM.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/dotsMethods.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/evalSource.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/findClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/findMethods.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/fixPrevious.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/genericFunction-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/getClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/getMethod.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/getPackageName.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/hasArg.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/implicitGeneric.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/inheritedSlotNames.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/initialize-methods.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/is.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/isSealedMethod.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/localRefClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/method.skeleton.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/new.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/nonStructure-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/promptClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/promptMethods.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/refClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/representation.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/selectSuperClasses.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/setClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/setClassUnion.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/setGeneric.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/setLoadActions.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/setMethod.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/setOldClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/setSClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/show.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/showMethods.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/signature-class.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/slot.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/stdRefClass.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/testInheritedMethods.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/validObject.tex', '/home/lzhao/tmp/RtmpZy1R7l/ltx5573594f0cc9/zBasicFunsList.tex'))); .Internal(toupper(argv[[1]]))"); } @@ -49,8 +49,8 @@ public class TestBuiltin_toupper extends TestBase { assertEval("{ toupper(c()) }"); assertEval("{ toupper(NA) }"); - assertEval(Ignored.Unknown, "{ toupper(1E100) }"); - assertEval(Ignored.Unknown, "{ m <- matrix(\"hi\") ; toupper(m) }"); - assertEval(Ignored.Unknown, "{ toupper(c(a=\"hi\", \"hello\")) }"); + assertEval(Ignored.OutputFormatting, "{ toupper(1E100) }"); + assertEval("{ m <- matrix(\"hi\") ; toupper(m) }"); + assertEval(Ignored.Unimplemented, "{ toupper(c(a=\"hi\", \"hello\")) }"); } } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestSimpleAttributes.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestSimpleAttributes.java index b7056d5dca..29ff4dfa17 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestSimpleAttributes.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestSimpleAttributes.java @@ -119,6 +119,7 @@ public class TestSimpleAttributes extends TestBase { assertEval("{ x <- c(a=1, b=2) ; attr(x, \"myatt\") <- 1; array(x) }"); assertEval("{ x <- \"a\" ; attr(x, \"myatt\") <- 1; toupper(x) }"); + assertEval("{ x <- \"a\" ; attr(x, \"myatt\") <- 1; tolower(x) }"); assertEval("{ m <- matrix(1:6, nrow=2) ; attr(m,\"a\") <- 1 ; diag(m) <- c(1,1) ; m }"); assertEval("{ x <- c(a=1) ; attr(x, \"myatt\") <- 1; log10(x) }"); assertEval("{ x <- c(a=1) ; attr(x, \"myatt\") <- 1; nchar(x) }"); // specific to diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/rpackages/TestVanillaPackage.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/rpackages/TestVanillaPackage.java index 5b395ceecd..3c94ad8785 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/rpackages/TestVanillaPackage.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/rpackages/TestVanillaPackage.java @@ -52,16 +52,8 @@ public class TestVanillaPackage extends TestRPackages { @Test public void testSimpleFunction() { - /* - * This test fails because FastR doesn't install the package correctly. In particular, the - * ReplacementNode serializes "y[x] <- z" to "`[<-`(y, x, z)", where it should create - * "y <- `[<-`(y, x, z)" (i.e., it doesn't actually change the variable). This causes - * replacements that are part of lazy-loaded library functions to have no effect if the - * package in question was installed using FastR. - */ - assertEval(Ignored.ImplementationError, - TestBase.template("{ library(\"vanilla\", lib.loc = \"%0\"); r <- functionTest(c(1,2,3,4,5,6),8:10); detach(\"package:vanilla\"); r }", - new String[]{packagePaths.rpackagesLibs.toString()})); + assertEval(TestBase.template("{ library(\"vanilla\", lib.loc = \"%0\"); r <- functionTest(c(1,2,3,4,5,6),8:10); detach(\"package:vanilla\"); r }", + new String[]{packagePaths.rpackagesLibs.toString()})); } } -- GitLab