Skip to content
Snippets Groups Projects
Commit f55ab24f authored by Adam Welc's avatar Adam Welc
Browse files

Temporary override for Sys.time function since we do not handle POSIXct and...

Temporary override for Sys.time function since we do not handle POSIXct and POSIXlt objects at the moment.
parent 3ae6eff5
No related branches found
No related tags found
No related merge requests found
# File src/library/base/R/datetime.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2014 The R Core Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of the GNU General Public License is available at
# http://www.r-project.org/Licenses/
# TODO fix the problem with .POSIXct - the following implementations
# of format are obviously wrong but it's better than raising an exception
# whenever Sys.time() is called (and it's mostly used for printing timestamps)
format.POSIXlt <- function(x, format = "", usetz = FALSE, ...)
{
format.default(x)
}
format.POSIXct <- function(x, format = "", tz = "", usetz = FALSE, ...)
{
format.default(x)
}
......@@ -730,6 +730,8 @@ public class TestSimpleBuiltins extends TestBase {
assertEval(Ignored.Unknown, "{ as.character(list(list(c(\"hello\", \"hi\")))) }");
assertEval(Ignored.Unknown, "{ as.character(list(c(2L, 3L))) }");
assertEval(Ignored.Unknown, "{ as.character(list(c(2L, 3L, 5L))) }");
assertEval("{ x<-as.character(Sys.time()) }");
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment