EDIT: my issue was unrelated to the question - the problem wound up being improper spacing.
I have a package that I’d like to have some tests built in for. There is a structure that wraps some functionality in a C++ library, so I have overloaded getproperty
for it, so it looks a bit un-Julian.
mutable struct Thing
p::Ptr{Cvoid}
end
function Base.getproperty(this::Thing, s::Symbol)
if s == :Foo
function foo()
# ... does stuff with pointer
end
else
getfield(this, s)
end
end
Anyhow, I want to start off my test with a setup call, and then run a sequence of tests, but this doesn’t work:
using Test
a = Thing()
@testset "Ensure Foo-ness" begin
@test a.Foo()
# ...
end
ERROR: LoadError: syntax: "begin" at /home/frylock/opt/Wrapper/test/runtests.jl:5 expected "end", got "a"
What is the right way to handle setup/teardown?