new automated tests

This commit is contained in:
Daniel Winkler 2026-05-24 00:27:46 +10:00
commit 2a521eeabd
7 changed files with 162 additions and 23 deletions

29
tests/ed/test.R Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env Rscript
packages <- c("arrow", "data.table", "fixest", "nvimcom")
failed <- character(0)
for (pkg in packages) {
ok <- tryCatch(
{
# nvimcom requires Neovim; skip loading but check it's installed
if (pkg == "nvimcom") {
requireNamespace(pkg, quietly = TRUE)
} else {
library(pkg, character.only = TRUE, quietly = TRUE)
}
TRUE
},
error = function(e) FALSE
)
if (!ok) {
failed <- c(failed, pkg)
}
}
if (length(failed) > 0) {
cat(sprintf("FAIL: %s\n", paste(failed, collapse = ", ")))
quit(status = 1)
}
cat("PASS: all packages loaded\n")

19
tests/ed/test.jl Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env julia
packages = ["StatsBase"]
failed = String[]
for pkg in packages
try
@eval using $pkg
catch
push!(failed, pkg)
end
end
if !isempty(failed)
@error "FAIL: $(join(failed, ", "))"
exit(1)
end
println("PASS: all packages loaded")

17
tests/ed/test.py Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env python3
import sys
packages = ["requests"]
failed = []
for pkg in packages:
try:
__import__(pkg)
except ImportError:
failed.append(pkg)
if failed:
sys.stderr.write(f"FAIL: {', '.join(failed)}\n")
sys.exit(1)
print("PASS: all packages loaded")