Skip to content

Commit 3f02ed3

Browse files
authored
Use setdiffdomain in spaces tests (#340)
* Use setdiffdomain in spaces tests * setdiffdomain in ODETest * setdiffdomain in PDETest * setdiffdomain in SpeedODETest
1 parent e43ab30 commit 3f02ed3

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

test/ODETest.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module ODETest
22

33
using ApproxFunOrthogonalPolynomials
44
using ApproxFunBase
5+
using DomainSets: setdiffdomain
56
using SpecialFunctions
67
using Test
78
using LazyArrays
@@ -130,7 +131,7 @@ include("testutils.jl")
130131
end
131132

132133
@testset "Union of intervals" begin
133-
x=Fun(identity,(-2..15) \ [-1,0])
134+
x=Fun(identity, setdiffdomain(-2..15, [-1,0]))
134135
sp=space(x)
135136

136137
B = [Dirichlet(sp);continuity(sp,0:1)]

test/PDETest.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module PDETest
22

33
using ApproxFunBase
44
using ApproxFunOrthogonalPolynomials
5+
using DomainSets: setdiffdomain
56
using LinearAlgebra
67
using Test
78
using ApproxFunBase: Block, ldiv_coefficients
@@ -275,7 +276,7 @@ include("testutils.jl")
275276
end
276277

277278
@testset "concatenate InterlaceOperator" begin
278-
a=Fun(x -> 0 x 0.5 ? 0.5 : 1, Domain(-1..1) \ [0,0.5])
279+
a=Fun(x -> 0 x 0.5 ? 0.5 : 1, setdiffdomain(Domain(-1..1), [0,0.5]))
279280
@test a(0.1) == 0.5
280281
@test a(0.7) == 1.0
281282
s=space(a)

test/SpacesTest.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using ApproxFunOrthogonalPolynomials
44
using SpecialFunctions
55
using LinearAlgebra
66
using Test
7-
using DomainSets: UnionDomain
7+
using DomainSets: UnionDomain, setdiffdomain
88
using ApproxFunBase: space, SpaceOperator
99
using ApproxFunBaseTest: testbandedoperator, testraggedbelowoperator,
1010
testtransforms, testfunctional
@@ -90,7 +90,7 @@ using ApproxFunBaseTest: testbandedoperator, testraggedbelowoperator,
9090
@test norm(max(x,x)-x)<100eps()
9191
@test norm(min(x,x)-x)<100eps()
9292

93-
f3=Fun(x->x<-0.05 ? -1.0 : (x<0.45 ? 4*(x-.2) : 1), (-1..1) \ [-0.05,0.45])
93+
f3=Fun(x->x<-0.05 ? -1.0 : (x<0.45 ? 4*(x-.2) : 1), setdiffdomain(-1..1, [-0.05,0.45]))
9494
@test norm(f2.(range(-1,stop=1,length=10))-f3.(range(-1,stop=1,length=10))) < 4eps()
9595
end
9696

@@ -332,7 +332,7 @@ using ApproxFunBaseTest: testbandedoperator, testraggedbelowoperator,
332332
end
333333

334334
@testset "remove point" begin
335-
f = Fun(identity, (-1..1) \ 0)
335+
f = Fun(identity, setdiffdomain(-1..1, 0))
336336
@test f(0.1) 0.1
337337
@test f(-0.1) -0.1
338338
end

test/SpeedODETest.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module SpeedODETest
22
using ApproxFunOrthogonalPolynomials
33
using SpecialFunctions
4+
using DomainSets: setdiffdomain
45
using Test
56
using ApproxFunBase: ldiv_coefficients
67
using LinearAlgebra
@@ -82,7 +83,7 @@ println("Complex exp: Time should be 0.03")
8283

8384

8485
## Piecewise
85-
x=Fun(identity,Domain(-20..15) \ [-10.,-5.,0.,1.])
86+
x=Fun(identity, setdiffdomain(Domain(-20..15), [-10.,-5.,0.,1.]))
8687
sp=space(x)
8788
D=Derivative(sp)
8889
B=[Dirichlet(sp);continuity(sp,0:1)]

0 commit comments

Comments
 (0)