|
60 | 60 |
|
61 | 61 | is_finite_nonzero(x) = isfinite(x) && !iszero(x) |
62 | 62 |
|
| 63 | +VERSION >= v"1.11.0-DEV.469" && @testset "public variables" begin |
| 64 | + module_names = [:DefaultSymbols] |
| 65 | + private_vars = [:BCAST_PROPAGATE_CALLS, :allowed_funcs, :basefactors, :prefixdict, :promotion, :si_no_prefix, :si_prefixes, :unitmodules] |
| 66 | + private_fns = [:abbr, :abs2_fast, :abs_fast, :affinetranslation, :affineunit, :base, :basefactor, :basefactors_expr, :colon, |
| 67 | + :colonstartstop, :conj_fast, :convfact, :convfact_floattype, :dimtype, :expfn, :fp_overflow_underflow, :fromlog, |
| 68 | + :gaintype, :genericunit, :get_T, :has_unit_spacing, :inv_fast, :isrootpower, :isrootpower_dim, :isunitless, :leveltype, |
| 69 | + :logfn, :lookup_units, :name, :numtype, :power, :prefactor, :preferunits, :prefix, :print_closing_bracket, |
| 70 | + :print_opening_bracket, :printed_length, :promote_to_derived, :promote_unit, :quantitytype, :register, :showrep, :showval, |
| 71 | + :sign_fast, :sortexp, :superscript, :tens, :tensfactor, :tolog, :try_uconvert, :uconvert_affine, :unwrap, :ustrcheck_bool] |
| 72 | + |
| 73 | + _basenames = names(Base; all=true) |
| 74 | + unitful_ids = filter(x -> !startswith(string(x), r"#|@"), names(Unitful; all=true)) |
| 75 | + base_overloaded_names = filter(x -> x in _basenames, unitful_ids) |
| 76 | + undescored_names = filter(x -> startswith(string(x), "_"), unitful_ids) |
| 77 | + private_names = vcat(module_names, private_fns, private_vars, undescored_names) |
| 78 | + exported_names = filter(x -> Base.isexported(Unitful, x), unitful_ids) |
| 79 | + public_names = filter(x -> Base.ispublic(Unitful, x), unitful_ids) |
| 80 | + other_names = setdiff(unitful_ids, union(private_names, exported_names, base_overloaded_names, public_names)) |
| 81 | + isempty(other_names) || |
| 82 | + @warn """For variables in $(other_names): declare as public or exported, or prepend underscore, or add to a private variables list in testset "public variables" """ |
| 83 | + |
| 84 | + @test isempty(other_names) |
| 85 | +end |
63 | 86 | @testset "Construction" begin |
64 | 87 | @test isa(NoUnits, FreeUnits) |
65 | 88 | @test typeof(𝐋) === Unitful.Dimensions{(Unitful.Dimension{:Length}(1),)} |
@@ -2547,6 +2570,8 @@ using REPL # This is necessary to make `@doc` work correctly |
2547 | 2570 | """ |
2548 | 2571 | end |
2549 | 2572 |
|
| 2573 | + |
| 2574 | + |
2550 | 2575 | # Test precompiled Unitful extension modules |
2551 | 2576 | mktempdir() do load_path |
2552 | 2577 | mktempdir() do load_cache_path |
|
0 commit comments