[Rcpp-devel] Rcpp 100'th unit test function
Romain François
francoisromain at free.fr
Mon Jan 11 22:29:10 CET 2010
Hi,
Just to let you know that we have reached 100 unit test functions in
Rcpp with the rev 347.
test#100 is testing operator+= on CharacterVector::StringProxy. Here it
is :
test.CharacterVector.plusequals <- function(){
funx <- cfunction(signature(), '
CharacterVector x(2) ;
x[0] = "foo" ;
x[1] = "bar" ;
x[0] += "bar" ;
x[1] += x[0] ;
return x ;
', Rcpp=TRUE, verbose=FALSE, includes = "using namespace Rcpp;" )
checkEquals( funx(), c("foobar", "barfoobar"),
msg = "StringProxy::operator+=" )
}
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/JOlc : External pointers with Rcpp
|- http://tr.im/JFqa : R Journal, Volume 1/2, December 2009
`- http://tr.im/IW9B : C++ exceptions at the R level
More information about the Rcpp-devel
mailing list