test_that("NAMESPACE roxygen contract keeps expected exports and methods", { ns_file <- file.path(getNamespaceInfo("mfrmr", "path"), "NAMESPACE") expect_true(file.exists(ns_file)) ns_lines <- readLines(ns_file, warn = FALSE) expect_true(any(grepl("^# Generated by roxygen2: do not edit by hand$", ns_lines))) exports <- sub("^export\\((.*)\\)$", "\\1", grep("^export\\(", ns_lines, value = TRUE)) expected_exports <- c( "analyze_dff", "analyze_dif", "analyze_facet_equivalence", "analyze_residual_pca", "anchor_to_baseline", "apa_table", "audit_mfrm_anchors", "bias_count_table", "bias_interaction_report", "bias_iteration_report", "bias_pairwise_report", "build_apa_outputs", "build_equating_chain", "build_fixed_reports", "build_mfrm_manifest", "build_mfrm_replay_script", "build_mfrm_sim_spec", "build_visual_summaries", "category_curves_report", "category_structure_report", "compare_mfrm", "compute_information", "data_quality_report", "describe_mfrm_data", "detect_anchor_drift", "diagnose_mfrm", "dif_interaction_table", "dif_report", "displacement_table", "estimate_all_bias", "estimate_bias", "estimation_iteration_report", "evaluate_mfrm_design", "evaluate_mfrm_signal_detection", "export_mfrm", "export_mfrm_bundle", "extract_mfrm_sim_spec", "facet_quality_dashboard", "facet_statistics_report", "facets_chisq_table", "facets_output_file_bundle", "facets_parity_report", "fair_average_table", "fit_mfrm", "interrater_agreement_table", "list_mfrmr_data", "load_mfrmr_data", "make_anchor_table", "measurable_summary_table", "mfrmRFacets", "mfrm_threshold_profiles", "plot_anchor_drift", "plot_bias_interaction", "plot_bubble", "plot_dif_heatmap", "plot_displacement", "plot_facet_equivalence", "plot_facet_quality_dashboard", "plot_facets_chisq", "plot_fair_average", "plot_information", "plot_interrater_agreement", "plot_qc_dashboard", "plot_qc_pipeline", "plot_residual_pca", "plot_unexpected", "plot_wright_unified", "predict_mfrm_population", "predict_mfrm_units", "sample_mfrm_plausible_values", "precision_audit_report", "rating_scale_table", "recommend_mfrm_design", "reference_case_audit", "reference_case_benchmark", "reporting_checklist", "run_mfrm_facets", "run_qc_pipeline", "simulate_mfrm_data", "specifications_report", "subset_connectivity_report", "unexpected_after_bias_table", "unexpected_response_table" ) expect_setequal(exports, expected_exports) s3 <- grep("^S3method\\(", ns_lines, value = TRUE) expected_s3 <- c( "S3method(print,mfrm_fit)", "S3method(print,mfrm_plot_bundle)", "S3method(print,mfrm_apa_text)", "S3method(print,apa_table)", "S3method(print,summary.apa_table)", "S3method(print,mfrm_data_description)", "S3method(print,mfrm_anchor_audit)", "S3method(print,mfrm_facets_run)", "S3method(print,summary.mfrm_data_description)", "S3method(print,summary.mfrm_anchor_audit)", "S3method(print,summary.mfrm_apa_outputs)", "S3method(print,summary.mfrm_facets_run)", "S3method(print,summary.mfrm_bundle)", "S3method(print,summary.mfrm_diagnostics)", "S3method(print,summary.mfrm_bias)", "S3method(print,summary.mfrm_fit)", "S3method(print,summary.mfrm_threshold_profiles)", "S3method(plot,apa_table)", "S3method(plot,mfrm_data_description)", "S3method(plot,mfrm_anchor_audit)", "S3method(plot,mfrm_design_evaluation)", "S3method(plot,mfrm_facet_equivalence)", "S3method(plot,mfrm_facets_run)", "S3method(plot,mfrm_bundle)", "S3method(plot,mfrm_facet_dashboard)", "S3method(plot,mfrm_fit)", "S3method(plot,mfrm_signal_detection)", "S3method(summary,apa_table)", "S3method(summary,mfrm_data_description)", "S3method(summary,mfrm_anchor_audit)", "S3method(summary,mfrm_apa_outputs)", "S3method(summary,mfrm_design_evaluation)", "S3method(summary,mfrm_dff)", "S3method(summary,mfrm_facets_run)", "S3method(summary,mfrm_bundle)", "S3method(summary,mfrm_diagnostics)", "S3method(summary,mfrm_bias)", "S3method(summary,mfrm_fit)", "S3method(summary,mfrm_threshold_profiles)", "S3method(as.data.frame,mfrm_fit)", "S3method(print,mfrm_comparison)", "S3method(print,summary.mfrm_comparison)", "S3method(summary,mfrm_comparison)", "S3method(print,mfrm_dff)", "S3method(print,summary.mfrm_dff)", "S3method(print,mfrm_dif)", "S3method(print,summary.mfrm_dif)", "S3method(summary,mfrm_dif)", "S3method(print,mfrm_dif_interaction)", "S3method(print,summary.mfrm_dif_interaction)", "S3method(summary,mfrm_dif_interaction)", "S3method(print,mfrm_dif_report)", "S3method(print,summary.mfrm_dif_report)", "S3method(summary,mfrm_dif_report)", "S3method(print,mfrm_anchored_fit)", "S3method(print,summary.mfrm_anchored_fit)", "S3method(summary,mfrm_anchored_fit)", "S3method(print,mfrm_anchor_drift)", "S3method(print,summary.mfrm_anchor_drift)", "S3method(summary,mfrm_anchor_drift)", "S3method(print,mfrm_equating_chain)", "S3method(print,summary.mfrm_equating_chain)", "S3method(summary,mfrm_equating_chain)", "S3method(print,mfrm_qc_pipeline)", "S3method(print,summary.mfrm_facet_dashboard)", "S3method(print,summary.mfrm_qc_pipeline)", "S3method(summary,mfrm_facet_dashboard)", "S3method(summary,mfrm_qc_pipeline)", "S3method(summary,mfrm_signal_detection)", "S3method(summary,mfrm_population_prediction)", "S3method(summary,mfrm_unit_prediction)", "S3method(summary,mfrm_plausible_values)" ) expect_setequal(s3, expected_s3) })