Boston Gelwan 1 hour ago
Wouldn’t using AutoActuary
do the trick?
Boston Gelwan 1 hour ago
Unless the issue is that they aren’t exported.
Heetbeet 1 hour ago
Yes, they aren’t exported, but I still want to test then without having to type AutoActuary.foo
or import foo
explicitely.
Boston Gelwan 1 hour ago
I actually don’t think explicit imports are very monstruous at all. I’d be less comfortable with importing all the non-exported members of a module with some hack than just writing things out.But perhaps you and I differ in a sense of style. (edited)
Heetbeet 1 hour ago
I like explicit import and also likes to hide most of my internal functions, but in the case of testing, I would like to have something as close to “living in the same namespace” as possible.
Mark Kittisopikul 1 hour ago
What happen if you implemented the tests within the module itself and then just ran them from runtests.jl ?
Tommy Hofmann 1 hour ago
for i in names(AutoActuary, all = true);try Main.eval(Meta.parse("import AutoActuary: " * string(i))); catch e; end; end
Fredrik Ekre 1 hour ago
import AutoActuary as aa
and then aa.foo
etc?
Heetbeet 43 minutes ago
@Mark Kittisopikul, like having them in a function and then call that function from runtests.jl? I haven’t thought about that, that might work. But I think it’s nice having all the tests at the testy location.
Heetbeet 32 minutes ago
I think I’m going to use this function, and then when I get closer to a “first release” remove it with the explicit names.
exportall() = begin
for i in names(AutoActuary, all=true)
if i in (:eval, :include)
continue
end
try
Main.eval(Meta.parse("import AutoActuary: $(i)"))
catch e
end
end
end
Heetbeet < 1 minute ago
Hmmm, but you end up losing all the VSCode clickiness action.