|
1 | 1 | # This file is a part of Julia. License is MIT: https://julialang.org/license
|
2 | 2 |
|
3 | 3 | using Dates, Random
|
4 |
| -isdefined(Main, :TestHelpers) || @eval Main include(joinpath(dirname(@__FILE__), "TestHelpers.jl")) |
| 4 | +isdefined(Main, :PhysQuantities) || @eval Main include("testhelpers/PhysQuantities.jl") |
| 5 | +using .Main.PhysQuantities |
5 | 6 |
|
6 | 7 | # Compare precision in a manner sensitive to subnormals, which lose
|
7 | 8 | # precision compared to widening.
|
@@ -187,10 +188,10 @@ end
|
187 | 188 | @test isnan(Float64(x0/0))
|
188 | 189 | @test isnan(Float64(x0/0.0))
|
189 | 190 |
|
190 |
| - x = Base.TwicePrecision(Main.TestHelpers.PhysQuantity{1}(4.0)) |
191 |
| - @test x.hi*2 === Main.TestHelpers.PhysQuantity{1}(8.0) |
| 191 | + x = Base.TwicePrecision(PhysQuantity{1}(4.0)) |
| 192 | + @test x.hi*2 === PhysQuantity{1}(8.0) |
192 | 193 | @test_throws ErrorException("Int is incommensurate with PhysQuantity") x*2 # not a MethodError for convert
|
193 |
| - @test x.hi/2 === Main.TestHelpers.PhysQuantity{1}(2.0) |
| 194 | + @test x.hi/2 === PhysQuantity{1}(2.0) |
194 | 195 | @test_throws ErrorException("Int is incommensurate with PhysQuantity") x/2
|
195 | 196 | end
|
196 | 197 | @testset "ranges" begin
|
@@ -1224,8 +1225,9 @@ Base.rem(x, y::NotReal) = rem(x, y.val)
|
1224 | 1225 | Base.isless(x, y::NotReal) = isless(x, y.val)
|
1225 | 1226 | @test (:)(1, NotReal(1), 5) isa StepRange{Int,NotReal}
|
1226 | 1227 |
|
1227 |
| -isdefined(Main, :TestHelpers) || @eval Main include("TestHelpers.jl") |
1228 |
| -using .Main.TestHelpers: Furlong |
| 1228 | +isdefined(Main, :Furlongs) || @eval Main include("testhelpers/Furlongs.jl") |
| 1229 | +using .Main.Furlongs |
| 1230 | + |
1229 | 1231 | @testset "dimensional correctness" begin
|
1230 | 1232 | @test length(Vector(Furlong(2):Furlong(10))) == 9
|
1231 | 1233 | @test length(range(Furlong(2), length=9)) == 9
|
|
0 commit comments