|
1 | 1 | # Note: some of CodeTracking's functionality can only be tested by Revise |
2 | 2 |
|
3 | 3 | using CodeTracking |
4 | | -using Test, InteractiveUtils, LinearAlgebra |
| 4 | +using Test, InteractiveUtils, LinearAlgebra, SparseArrays |
5 | 5 | # Note: ColorTypes needs to be installed, but note the intentional absence of `using ColorTypes` |
6 | 6 |
|
7 | 7 | using CodeTracking: line_is_decl |
@@ -127,6 +127,17 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j |
127 | 127 | B = Hermitian(hcat([one(BigFloat) + im])) |
128 | 128 | m = @which cholesky(B) |
129 | 129 | @test startswith(definition(String, m)[1], "cholesky") |
| 130 | + |
| 131 | + # Ensure that we don't error on difficult cases |
| 132 | + m = which(+, (AbstractSparseVector, AbstractSparseVector)) # defined inside an `@eval` |
| 133 | + d = definition(String, m) |
| 134 | + @test d === nothing || isa(d[1], String) |
| 135 | + |
| 136 | + # Check for existence of file |
| 137 | + id = Base.PkgId("__PackagePrecompilationStatementModule") |
| 138 | + mod = Base.root_module(id) |
| 139 | + m = first(methods(getfield(mod, :eval))) |
| 140 | + @test definition(String, m) === nothing |
130 | 141 | end |
131 | 142 |
|
132 | 143 | @testset "With Revise" begin |
|
0 commit comments