R Under development (unstable) (2026-10-22 r90748 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # Vollständige Offline-Referenzen gegen den installierten Namespace. > if (requireNamespace("jsonlite", quietly = TRUE)) { + verbindung <- gzfile(system.file("daten", "referenzen.json.gz", package = "bgbcalc"), "rt", encoding = "UTF-8") + faelle <- jsonlite::fromJSON(paste(readLines(verbindung, warn = FALSE), collapse = "\n"), simplifyVector = FALSE) + close(verbindung) + ergebnisse <- list() + for (fall in faelle) { + ergebnis <- tryCatch(do.call(getExportedValue("bgbcalc", fall$funktion), fall$eingaben), + bgb_berechnungsfehler = function(e) list(status = e$status, wert = NULL)) + if (!identical(ergebnis$status, fall$erwartung$status) || + !isTRUE(all.equal(ergebnis$wert, fall$erwartung$wert))) stop(fall$fall_id) + ergebnisse[[fall$fall_id]] <- ergebnis + } + ausgabe <- Sys.getenv("BGBCALC_R_ERGEBNISSE") + if (nzchar(ausgabe)) jsonlite::write_json(ergebnisse, ausgabe, auto_unbox = TRUE, null = "null", digits = 17) + cat(length(faelle), "installierte native R-Referenzfälle bestanden.\n") + } else { + message("Referenzprüfung übersprungen: vorgeschlagenes Paket jsonlite fehlt.") + } 15718 installierte native R-Referenzfälle bestanden. > > proc.time() user system elapsed 50.17 1.82 51.98