11# !/usr/bin/env r
22#
3- # Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois
3+ # Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
44#
55# This file is part of Rcpp.
66#
@@ -98,78 +98,78 @@ if (.runThisTest) {
9898 }
9999
100100 test.AreMacrosDefined <- function (){
101- checkTrue( Rcpp ::: areMacrosDefined( " __cplusplus" ) )
101+ checkTrue( Rcpp ::: areMacrosDefined( " __cplusplus" ) )
102102 }
103-
103+
104104 test.rcout <- function (){
105105 # # define test string that is written to two files
106106 teststr <- " First line.\n Second line."
107107
108108 rcppfile <- tempfile()
109109 rfile <- tempfile()
110-
110+
111111 # # write to test_rcpp.txt from Rcpp
112112 test_rcout(rcppfile , teststr )
113-
113+
114114 # # write to test_r.txt from R
115115 cat( teststr , file = rfile , sep = ' \n ' )
116-
116+
117117 # # compare whether the two files have the same data
118- checkEquals( readLines(rcppfile ), readLines(rfile ), msg = " Rcout output" )
118+ checkEquals( readLines(rcppfile ), readLines(rfile ), msg = " Rcout output" )
119119 }
120120
121121 test.rcout.complex <- function (){
122122
123123 rcppfile <- tempfile()
124124 rfile <- tempfile()
125-
125+
126126 z <- complex (real = sample(1 : 10 , 1 ), imaginary = sample(1 : 10 , 1 ))
127-
127+
128128 # # write to test_rcpp.txt from Rcpp
129129 test_rcout_rcomplex(rcppfile , z )
130-
130+
131131 # # write to test_r.txt from R
132132 cat( z , file = rfile , sep = ' \n ' )
133-
133+
134134 # # compare whether the two files have the same data
135- checkEquals( readLines(rcppfile ), readLines(rfile ), msg = " Rcout Rcomplex" )
135+ checkEquals( readLines(rcppfile ), readLines(rfile ), msg = " Rcout Rcomplex" )
136136 }
137137
138138 test.na_proxy <- function (){
139- checkEquals(
140- na_proxy(),
141- rep(c(TRUE ,TRUE ,TRUE ,FALSE ,FALSE ,FALSE ,FALSE ,FALSE ,FALSE ) , 2 ),
139+ checkEquals(
140+ na_proxy(),
141+ rep(c(TRUE ,TRUE ,TRUE ,FALSE ,FALSE ,FALSE ,FALSE ,FALSE ,FALSE ) , 2 ),
142142 msg = " Na_Proxy NA == handling"
143- )
143+ )
144144 }
145145
146146 test.StretchyList <- function (){
147- checkEquals(
147+ checkEquals(
148148 stretchy_list(),
149149 pairlist( " foo" , 1L , 3.2 )
150150 )
151151 }
152152
153153 test.named_StretchyList <- function (){
154- checkEquals(
154+ checkEquals(
155155 named_stretchy_list(),
156156 pairlist( a = " foo" , b = 1L , c = 3.2 )
157157 )
158158 }
159-
159+
160160 test.stop.variadic <- function (){
161161 m <- tryCatch( test_stop_variadic(), error = function (e ){
162- conditionMessage(e )
162+ conditionMessage(e )
163163 })
164- checkEquals( m , " foo 3" )
164+ checkEquals( m , " foo 3" )
165165 }
166166
167167 test.NullableForNull <- function () {
168168 M <- matrix (1 : 4 , 2 , 2 )
169169 checkTrue( testNullableForNull(NULL ) )
170170 checkTrue( ! testNullableForNull(M ) )
171171 }
172-
172+
173173 test.NullableForNotNull <- function () {
174174 M <- matrix (1 : 4 , 2 , 2 )
175175 checkTrue( ! testNullableForNotNull(NULL ) )
@@ -180,7 +180,7 @@ if (.runThisTest) {
180180 M <- matrix (1 : 4 , 2 , 2 )
181181 checkEquals( testNullableOperator(M ), M )
182182 }
183-
183+
184184 test.NullableAccessGet <- function () {
185185 M <- matrix (1 : 4 , 2 , 2 )
186186 checkEquals( testNullableGet(M ), M )
@@ -209,4 +209,9 @@ if (.runThisTest) {
209209 checkEquals(testNullableString(), " " )
210210 checkEquals(testNullableString(" blah" ), " blah" )
211211 }
212+
213+ test.bib <- function () {
214+ checkTrue(nchar(Rcpp ::: bib()) > 0 , msg = " bib file" )
215+ }
216+
212217}
0 commit comments