Hi,
I have defined a constructor as follows:
struct ResourceParams
screen_name::String
user_id::Union{Integer, Nothing}
since_id::Union{Integer, Nothing}
count::Union{Integer, Nothing}
max_id::Union{Integer, Nothing}
trim_user::Union{Integer, Nothing}
exclude_replies::Union{Integer, Nothing}
# Custom Constructor for the Type Signature
ResourceParams(
screen_name;
user_id = nothing,
science_id = nothing,
count=1,
max_id=nothing,
trim_user=0,
exclude_replies=1,
) = (
count isa Integer && count < 1 ?
error("Count must have to be greter than or equal to 1") :
new(screen_name, user_id, science_id, count, max_id, trim_user, exclude_replies)
)
end
Its executing if I run it in the REPL. But when running the test pkg> test
it throws error on the error line as follows ERROR: LoadError: LoadError: Count must have to be greter than or equal to 1
Does any one knows the problem?
I have not implemented any Test. The test file is empty as follows:
using MyPackage
using Test
@testset "myfile.jl" begin
# Write your tests here.
@testset "Validate Types" begin
end
end
If I commented out the the line
# count isa Integer && count < 1 ?
# error("Count must have to be greter than or equal to 1") :
The test runs fine.
Thanks in advance!