|
| 1 | +using QuantumCumulants, Test |
| 2 | + |
| 3 | +@testset "best practices" begin |
| 4 | + using Aqua |
| 5 | + |
| 6 | + Aqua.test_ambiguities([QuantumCumulants]; broken = true) |
| 7 | + Aqua.test_piracies(QuantumCumulants; broken = true) |
| 8 | + Aqua.test_all(QuantumCumulants; ambiguities = false, piracies = false) |
| 9 | +end |
| 10 | + |
| 11 | +@testset "ExplicitImports" begin |
| 12 | + using ExplicitImports |
| 13 | + # @test check_no_implicit_imports(QuantumCumulants) == nothing |
| 14 | + @test check_all_explicit_imports_via_owners(QuantumCumulants) == nothing |
| 15 | + # @test check_all_explicit_imports_are_public(QuantumCumulants) == nothing |
| 16 | + # @test check_no_stale_explicit_imports(QuantumCumulants) == nothing |
| 17 | + # @test check_all_qualified_accesses_via_owners(QuantumCumulants) == nothing |
| 18 | + # @test check_all_qualified_accesses_are_public(QuantumCumulants) == nothing |
| 19 | + # @test check_no_self_qualified_accesses(QuantumCumulants) == nothing |
| 20 | +end |
| 21 | + |
| 22 | +if isempty(VERSION.prerelease) |
| 23 | + @testset "Code linting" begin |
| 24 | + using JET |
| 25 | + # JET.test_package(SecondQuantizedAlgebra; target_defined_modules=true) |
| 26 | + rep = report_package("QuantumCumulants") |
| 27 | + @show rep |
| 28 | + @test length(JET.get_reports(rep)) <= 306 |
| 29 | + @test_broken length(JET.get_reports(rep)) == 0 |
| 30 | + end |
| 31 | +end |
| 32 | + |
| 33 | +@testset "Concretely typed" begin |
| 34 | + import QuantumCumulants as QC |
| 35 | + using CheckConcreteStructs |
| 36 | + |
| 37 | + all_concrete(QC.CorrelationFunction) |
| 38 | + all_concrete(QC.Spectrum) |
| 39 | + |
| 40 | + all_concrete(QC.MeanfieldEquations) |
| 41 | + all_concrete(QC.IndexedMeanfieldEquations) |
| 42 | + all_concrete(QC.EvaledMeanfieldEquations) |
| 43 | + all_concrete(QC.ScaledMeanfieldEquations) |
| 44 | + |
| 45 | + all_concrete(QC.IndexedMeanfieldNoiseEquations) |
| 46 | + all_concrete(QC.MeanfieldNoiseEquations) |
| 47 | +end |
0 commit comments