Skip to content

Commit

Permalink
Update ExplicitImports.jl tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobjpeters committed Jun 13, 2024
1 parent 9eaf1b3 commit 21e0e80
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
6 changes: 4 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

using Base: Docs.HTML, Docs.Text, get_extension
using Base: get_extension
using Dates: Dates, Date, DateTime, Day, Hour, Minute, Second, Time, Week
using Documenter: Documenter, DocMeta.setdocmeta!, deploydocs, makedocs
using .Docs: HTML, Text
using .DocMeta: setdocmeta!
using Documenter: Documenter, deploydocs, makedocs
using LaTeXStrings: LaTeXStrings, LaTeXString, @L_str
using Luxor: Drawing, finish, julia_blue, julia_green, julia_purple, julia_red, rect, sethue
using Markdown: Markdown, MD, @md_str
Expand Down
5 changes: 4 additions & 1 deletion src/Typstry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import Base:
getindex, hash, ignorestatus, isvalid, iterate, keys, lastindex,
length, ncodeunits, pointer, repr, run, setenv, show, showerror
using Artifacts: @artifact_str
using Base: Docs.HTML, Docs.Text, Iterators.Stateful, Meta.parse, escape_raw_string, escape_string
using Base: escape_raw_string, escape_string
using .Docs: HTML, Text
using .Iterators: Stateful
using .Meta: parse
using PrecompileTools: @compile_workload
using Typst_jll: typst

Expand Down
4 changes: 3 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Documenter = "1"
ExplicitImports = "1"
27 changes: 23 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@

using ExplicitImports: check_no_implicit_imports, check_no_stale_explicit_imports
using Test: @testset, @test, detect_ambiguities, detect_unbound_args
using Base: get_extension
using ExplicitImports:
check_all_explicit_imports_are_public,
check_all_explicit_imports_via_owners,
check_all_qualified_accesses_are_public,
check_all_qualified_accesses_via_owners,
check_no_implicit_imports,
check_no_self_qualified_accesses,
check_no_stale_explicit_imports
using Dates: Dates
using Documenter: DocMeta.setdocmeta!, doctest
using LaTeXStrings: LaTeXStrings
using Markdown: Markdown
using Test: @testset, @test, detect_ambiguities, detect_unbound_args
using Typstry

@testset "`check_no_implicit_imports` and `check_no_stale_explicit_imports`" begin
const MarkdownExtension = get_extension(Typstry, :MarkdownExtension)

@testset "ExplicitImports.jl" begin
@test isnothing(check_all_explicit_imports_are_public(Typstry; ignore = (:MD, :Stateful,
:code_mode, :depth, :escape_raw_string, :indent, :parse, :print_parameters, :show_raw, :workload)))
@test isnothing(check_all_explicit_imports_via_owners(Typstry))
@test isnothing(check_all_qualified_accesses_are_public(Typstry))
@test isnothing(check_all_qualified_accesses_via_owners(Typstry))
@test isnothing(check_no_implicit_imports(Typstry))
@test isnothing(check_no_stale_explicit_imports(Typstry; ignore = (:Docs, :Iterators, :Meta)))
@test isnothing(check_no_self_qualified_accesses(Typstry))
@test isnothing(check_no_stale_explicit_imports(Typstry))
end

@testset "`detect_ambiguities` and `detect_unbound_args`" begin
Expand Down

0 comments on commit 21e0e80

Please sign in to comment.