Skip to content

Commit f09a6aa

Browse files
authored
test: add ExplicitImports checks (#14)
1 parent f0010e9 commit f09a6aa

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.1.0"
66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
88
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
9-
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
109

1110
[compat]
1211
Aqua = "0.8.11"
@@ -16,7 +15,6 @@ DocStringExtensions = "0.9.4"
1615
ExplicitImports = "1.11"
1716
JET = "0.9.18, 0.10"
1817
LaTeXStrings = "1.4"
19-
Printf = "1.10"
2018
Test = "1.10"
2119
julia = "1.10"
2220

src/VanVleckRecursion.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ $(DocStringExtensions.README)
33
"""
44
module VanVleckRecursion
55

6-
using DocStringExtensions
7-
using Printf, LaTeXStrings
6+
using DocStringExtensions: DocStringExtensions
7+
using LaTeXStrings: LaTeXStrings
88

99
# Export Kamiltonian and Generator functions
1010
export K, S, kamiltonian_get, generator_get, set_hamiltonian!, clear_caches!, latex

src/collections.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Key operations:
2020
Compute Poisson brackets between all pairs of terms from two collections.
2121
2222
Implements distributive property: {A + B, C + D} = {A,C} + {A,D} + {B,C} + {B,D}.
23-
Essential for building K⁽ⁿ,ₖ⁾ expressions from lower-order terms.
23+
Essential for building K⁽ⁿ⁾,ₖ expressions from lower-order terms.
2424
2525
# Arguments
2626
- `terms1::Terms`: First collection

src/display.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function latex(terms::Terms; advanced::Bool=true)
275275
s *= "\\\\ \n"
276276
end
277277
end
278-
return latexstring(s)
278+
return LaTeXStrings.latexstring(s)
279279
end
280280

281281
# Display methods for Van Vleck recursion terms and collections
@@ -323,3 +323,6 @@ length(k3_terms) # Number grows with recursion order
323323
```
324324
"""
325325
Base.length(terms::Terms) = length(terms.terms)
326+
327+
# const T_LATEX = Union{<:QField,Diagrams,Diagram,Edge}
328+
# Base.show(io::IO, ::MIME"text/latex", x::T_LATEX) = write(io, latexify(x))

test/runtests.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ end
2020

2121
@testset "ExplicitImports" begin
2222
using ExplicitImports
23-
@test check_no_stale_explicit_imports(VanVleckRecursion) == nothing
23+
@test check_no_implicit_imports(VanVleckRecursion) == nothing
2424
@test check_all_explicit_imports_via_owners(VanVleckRecursion) == nothing
25+
@test check_all_explicit_imports_are_public(VanVleckRecursion) == nothing
26+
@test check_no_stale_explicit_imports(VanVleckRecursion) == nothing
27+
@test check_all_qualified_accesses_via_owners(VanVleckRecursion) == nothing
28+
@test check_all_qualified_accesses_are_public(VanVleckRecursion) == nothing
29+
@test check_no_self_qualified_accesses(VanVleckRecursion) == nothing
2530
end
2631

2732
@testset "best practices" begin
@@ -31,6 +36,14 @@ end
3136
Aqua.test_all(VanVleckRecursion; ambiguities=false)
3237
end
3338

39+
@testset "Concretely typed" begin
40+
import VanVleckRecursion as VVR
41+
using CheckConcreteStructs
42+
43+
all_concrete(VVR.Term)
44+
all_concrete(VVR.Terms)
45+
end
46+
3447
# Include all test files
3548
include("types.jl")
3649
include("operations.jl")

0 commit comments

Comments
 (0)