[Rcpp-commits] r1062 - pkg/Rcpp/inst/unitTests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Apr 17 20:58:57 CEST 2010
Author: romain
Date: 2010-04-17 20:58:56 +0200 (Sat, 17 Apr 2010)
New Revision: 1062
Modified:
pkg/Rcpp/inst/unitTests/runit.CharacterVector.R
Log:
unit test for previous commit
Modified: pkg/Rcpp/inst/unitTests/runit.CharacterVector.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.CharacterVector.R 2010-04-17 18:53:23 UTC (rev 1061)
+++ pkg/Rcpp/inst/unitTests/runit.CharacterVector.R 2010-04-17 18:58:56 UTC (rev 1062)
@@ -229,6 +229,16 @@
msg="CharacterVector from list")
}
+test.CharacterVector.find <- function(){
+
+ fx <- cppfunction( signature( x = "character"),
+ '
+ CharacterVector y(x) ;
+ CharacterVector::iterator it = std::find( y.begin(), y.end(), "foo" ) ;
+ return wrap( std::distance( y.begin(), it ) ) ;
+ ' )
+
+ checkEquals( fx( c("bar", "foo", "bob") ), 1L, msg = "support for std::find in CharacterVector" )
+
+}
-
-
More information about the Rcpp-commits
mailing list