#
# Renjin : JVM-based interpreter for the R language for the statistical analysis
# Copyright Â© 2010-2018 BeDataDriven Groep B.V. and contributors
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, a copy is available at
# https://www.gnu.org/licenses/gpl-2.0.txt
#

# Generated by gen-unary-tests.R using GNU R version 3.5.3 (2019-03-11)
library(hamcrest)
Sys.setlocale('LC_COLLATE', 'C')
as.character.foo <- function(...) 41L
as.vector.foo <- function(...) 99
as.vector.bar <- function(...) 98
Math.bar <- function(...) 44
Summary.bar <- function(...) 45
Ops.bar <- function(...) 46
test.as.character.1 <- function() assertThat(as.character(NULL), identicalTo(character(0)))
test.as.character.2 <- function() assertThat(as.character(logical(0)), identicalTo(character(0)))
test.as.character.3 <- function() assertThat(as.character(c(TRUE, TRUE, FALSE, FALSE, TRUE)), identicalTo(c("TRUE", "TRUE", "FALSE", "FALSE", "TRUE")))
test.as.character.4 <- function() assertThat(as.character(structure(c(TRUE, FALSE), .Names = c("a", ""))), identicalTo(c("TRUE", "FALSE")))
test.as.character.5 <- function() assertThat(as.character(c(TRUE, FALSE, NA)), identicalTo(c("TRUE", "FALSE", NA)))
test.as.character.6 <- function() assertThat(as.character(integer(0)), identicalTo(character(0)))
test.as.character.7 <- function() assertThat(as.character(structure(integer(0), .Names = character(0))), identicalTo(character(0)))
test.as.character.8 <- function() assertThat(as.character(1:3), identicalTo(c("1", "2", "3")))
test.as.character.9 <- function() assertThat(as.character(c(1L, NA, 4L, NA, 999L)), identicalTo(c("1", NA, "4", NA, "999")))
test.as.character.10 <- function() assertThat(as.character(c(1L, 2L, 1073741824L, 1073741824L)), identicalTo(c("1", "2", "1073741824", "1073741824")))
test.as.character.11 <- function() assertThat(as.character(numeric(0)), identicalTo(character(0)))
test.as.character.12 <- function() assertThat(as.character(c(3.14159, 6.28319, 9.42478, 12.5664, 15.708)), identicalTo(c("3.14159", "6.28319", "9.42478", "12.5664", "15.708")))
test.as.character.13 <- function() assertThat(as.character(c(-3.14159, -6.28319, -9.42478, -12.5664, -15.708)), identicalTo(c("-3.14159", "-6.28319", "-9.42478", "-12.5664", "-15.708")))
test.as.character.14 <- function() assertThat(as.character(structure(1:2, .Names = c("a", "b"))), identicalTo(c("1", "2")))
test.as.character.15 <- function() assertThat(as.character(structure(c(1.5, 2.5), .Names = c("a", "b"))), identicalTo(c("1.5", "2.5")))
test.as.character.16 <- function() assertThat(as.character(c(1.5, 1.51, 0, 1.49, -30)), identicalTo(c("1.5", "1.51", "0", "1.49", "-30")))
test.as.character.17 <- function() assertThat(as.character(c(1.5, 1.51, 0, 1.49, -30, NA)), identicalTo(c("1.5", "1.51", "0", "1.49", "-30", NA)))
test.as.character.18 <- function() assertThat(as.character(c(1.5, 1.51, 0, 1.49, -30, NaN)), identicalTo(c("1.5", "1.51", "0", "1.49", "-30", "NaN")))
test.as.character.19 <- function() assertThat(as.character(c(1.5, 1.51, 0, 1.49, -30, Inf)), identicalTo(c("1.5", "1.51", "0", "1.49", "-30", "Inf")))
test.as.character.20 <- function() assertThat(as.character(c(1.5, 1.51, 0, 1.49, -30, -Inf)), identicalTo(c("1.5", "1.51", "0", "1.49", "-30", "-Inf")))
test.as.character.21 <- function() assertThat(as.character(character(0)), identicalTo(character(0)))
test.as.character.22 <- function() assertThat(as.character(c("4.1", "blahh", "99.9", "-413", NA)), identicalTo(c("4.1", "blahh", "99.9", "-413", NA)))
test.as.character.23 <- function() assertThat(as.character(complex(0)), identicalTo(character(0)))
test.as.character.24 <- function() assertThat(as.character(list(1, 2, 3)), identicalTo(c("1", "2", "3")))
test.as.character.25 <- function() assertThat(as.character(list(1, 2, NULL)), identicalTo(c("1", "2", "NULL")))
test.as.character.26 <- function() assertThat(as.character(list(1L, 2L, 3L)), identicalTo(c("1", "2", "3")))
test.as.character.27 <- function() assertThat(as.character(list(1L, 2L, NULL)), identicalTo(c("1", "2", "NULL")))
test.as.character.28 <- function() assertThat(as.character(list(1, 2, list(3, 4))), identicalTo(c("1", "2", "list(3, 4)")))
test.as.character.29 <- function() assertThat(as.character(list(1, 2, numeric(0))), identicalTo(c("1", "2", "numeric(0)")))
test.as.character.30 <- function() assertThat(as.character(list(3, "a", structure(list("b", list(TRUE, "c")), .Names = c("", "z")))), identicalTo(c("3", "a", "list(\"b\", z = list(TRUE, \"c\"))")))
test.as.character.31 <- function() assertThat(as.character(structure(list(1, 2, 3), .Names = c(NA, "", "b"))), identicalTo(c("1", "2", "3")))
test.as.character.32 <- function() assertThat(as.character(pairlist(41, "a", 21L)), identicalTo(c("41", "a", "21")))
test.as.character.33 <- function() assertThat(as.character(structure(pairlist(a = 41, 42))), identicalTo(c("41", "42")))
test.as.character.34 <- function() assertThat(as.character(structure(pairlist(a = 41, NULL))), identicalTo(c("41", "NULL")))
test.as.character.35 <- function() assertThat(as.character(structure(1:12, .Dim = 3:4)), identicalTo(c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12")))
test.as.character.36 <- function() assertThat(as.character(structure(1:12, .Dim = 3:4, .Dimnames = structure(list(    c("a", "b", "c"), c("d", "e", "f", "g")), .Names = c("x", "y")))), identicalTo(c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12")))
test.as.character.37 <- function() assertThat(as.character(structure(1:3, rando.attrib = 941L)), identicalTo(c("1", "2", "3")))
test.as.character.38 <- function() assertThat(as.character(structure(1:3, .Dim = 3L, .Dimnames = list(c("a", "b", "c")))), identicalTo(c("1", "2", "3")))
test.as.character.39 <- function() assertThat(as.character(structure(1:3, .Dim = 3L, .Dimnames = structure(list(    c("a", "b", "c")), .Names = "z"))), identicalTo(c("1", "2", "3")))
test.as.character.40 <- function() assertThat(as.character(structure(list("foo"), class = "foo")), identicalTo(41L))
test.as.character.41 <- function() assertThat(as.character(structure(list("bar"), class = "foo")), identicalTo(41L))
test.as.character.42 <- function() assertThat(as.character(quote(xyz)), identicalTo("xyz"))
test.as.character.43 <- function() assertThat(as.character(quote(sin(3.14))), identicalTo(c("sin", "3.14")))
test.as.character.44 <- function() assertThat(as.character("NaN"), identicalTo("NaN"))
test.as.character.45 <- function() assertThat(as.character("NABOOM!"), identicalTo("NABOOM!"))
test.as.character.46 <- function() assertThat(as.character("NaNaNabooboo"), identicalTo("NaNaNabooboo"))
test.as.character.47 <- function() assertThat(as.character("-Inf"), identicalTo("-Inf"))
test.as.character.48 <- function() assertThat(as.character("+Infinity"), identicalTo("+Infinity"))
test.as.character.49 <- function() assertThat(as.character("Infinity and beyond!"), identicalTo("Infinity and beyond!"))
test.as.character.50 <- function() assertThat(as.character("Infi"), identicalTo("Infi"))
test.as.character.51 <- function() assertThat(as.character("0.03f"), identicalTo("0.03f"))
test.as.character.52 <- function() assertThat(as.character("  0.0330   "), identicalTo("  0.0330   "))
test.as.character.53 <- function() assertThat(as.character(structure("foo", class = "foo")), identicalTo(41L))
test.as.character.54 <- function() assertThat(as.character(structure(list(1L, "bar"), class = "bar")), identicalTo(98))
