[Rcpp-commits] r3305 - pkg/int64/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 7 13:11:23 CET 2011


Author: romain
Date: 2011-11-07 13:11:23 +0100 (Mon, 07 Nov 2011)
New Revision: 3305

Modified:
   pkg/int64/inst/unitTests/runit.int64.R
Log:
unit test for names and names<-

Modified: pkg/int64/inst/unitTests/runit.int64.R
===================================================================
--- pkg/int64/inst/unitTests/runit.int64.R	2011-11-07 12:06:41 UTC (rev 3304)
+++ pkg/int64/inst/unitTests/runit.int64.R	2011-11-07 12:11:23 UTC (rev 3305)
@@ -97,3 +97,23 @@
        )     
 }
 
+test.names <- function(){
+    x <- as.int64( 1:5 )
+    checkTrue( is.null(names(x) ) )
+    names <- letters[1:5]
+    names(x) <- names
+    checkEquals( names(x), letters[1:5] )
+    names(x) <- NULL
+    checkTrue( is.null(names(x) ) )
+    
+    
+    x <- as.uint64( 1:5 )
+    checkTrue( is.null(names(x) ) )
+    names <- letters[1:5]
+    names(x) <- names
+    checkEquals( names(x), letters[1:5] )
+    names(x) <- NULL
+    checkTrue( is.null(names(x) ) )
+    
+}
+



More information about the Rcpp-commits mailing list