File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ 2016-12-03 Dirk Eddelbuettel <edd@debian.org>
2+
3+ * inst/unitTests/cpp/dates.cpp (Datetime_format): Additional ostream tests
4+ * inst/unitTests/runit.Date.R (test.Date.formating): Ditto
5+
162016-11-29 Dirk Eddelbuettel <edd@debian.org>
27
38 * DESCRIPTION (Version, Date): Roll minor version to 0.12.8.2
Original file line number Diff line number Diff line change @@ -182,3 +182,17 @@ std::string Date_format(Date d, std::string fmt) {
182182std::string Datetime_format (Datetime d, std::string fmt) {
183183 return d.format (fmt.c_str ());
184184}
185+
186+ // [[Rcpp::export]]
187+ std::string Date_ostream (Date d) {
188+ std::stringstream os;
189+ os << d;
190+ return os.str ();
191+ }
192+
193+ // [[Rcpp::export]]
194+ std::string Datetime_ostream (Datetime d) {
195+ std::stringstream os;
196+ os << d;
197+ return os.str ();
198+ }
Original file line number Diff line number Diff line change @@ -209,6 +209,9 @@ if (.runThisTest) {
209209 checkEquals(Date_format(d , " %Y/%m/%d" ),
210210 format(d , " %Y/%m/%d" ),
211211 msg = " Date.formating.given.format" )
212+ checkEquals(Date_ostream(d ),
213+ format(d ),
214+ msg = " Date.formating.ostream" )
212215
213216 Sys.setenv(TZ = oldTZ )
214217 }
@@ -227,6 +230,9 @@ if (.runThisTest) {
227230 checkEquals(Datetime_format(d , " %Y/%m/%d %H:%M:%S" ),
228231 format(d , " %Y/%m/%d %H:%M:%OS" ),
229232 msg = " Datetime.formating.given.format" )
233+ checkEquals(Datetime_ostream(d ),
234+ format(d , " %Y-%m-%d %H:%M:%OS" ),
235+ msg = " Datetime.formating.ostream" )
230236
231237 Sys.setenv(TZ = oldTZ )
232238 options(" digits.secs" = olddigits )
You can’t perform that action at this time.
0 commit comments