library(testthat) library(AutoEDA) #========================================================== # auto_eda() #========================================================== test_that("auto_eda returns AutoEDAReport", { x <- auto_eda(iris) expect_s3_class( x, "AutoEDAReport" ) }) test_that("auto_eda contains expected modules", { x <- auto_eda(iris) expect_named( x, c( "Summary", "Missing", "Numeric", "Categorical", "Correlation", "Outliers", "PCA", "Cluster", "Statistics" ) ) }) test_that("auto_eda accepts valid data.frame", { expect_no_error( auto_eda(iris) ) }) test_that("auto_eda rejects non-data.frame", { expect_error( auto_eda(1:10) ) }) test_that("auto_eda rejects empty data.frame", { expect_error( auto_eda(data.frame()) ) }) test_that("auto_eda works with datasets containing missing values", { d <- iris d$Sepal.Length[1:10] <- NA expect_no_error( auto_eda(d) ) }) test_that("auto_eda works with only numeric variables", { expect_no_error( auto_eda(iris[,1:4]) ) }) test_that("auto_eda works with mixed variable types", { d <- iris d$ID <- paste0("ID", seq_len(nrow(d))) expect_no_error( auto_eda(d) ) })