Skip to content

testapprox should be moved or inlined #133

Closed
@kimikage

Description

@kimikage

The "fixed" testset depends on testapprox which is defined in "test/normed.jl" (formerly named ufixed.jl).

@testset "testapprox" begin
for T in [Fixed{Int8,7}, Fixed{Int16,8}, Fixed{Int16,10}]
testapprox(T) # defined in ufixed.jl
end
end

function testapprox(::Type{T}) where {T}
for x = typemin(T):eps(T):typemax(T)-eps(T)
y = x+eps(T)
@test x y
@test y x
@test !(x y+eps(T))
end
end

This thwarts the selective execution of tests and causes an error(UndefVarError: testapprox not defined) in certain environments (e.g. Julia v1.0.3 32-bit ARMv7).

I think testapprox is not so complicated. It may be a good idea to inline the function or define it locally.
This may be off topic, but I also think there are too many test cases generated by testapprox (or its friend testtrunc). @test should be outside the loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions