Skip to content

Commit

Permalink
Add testset for default dims
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-arya committed Mar 6, 2023
1 parent 846a5bb commit 20de5e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,21 @@ end
@test @inferred(f9(plan_fft(zeros(10), 1), 10)) == 1/10
end

# Test that dims defaults to 1:ndims for fft-like functions
@testset "Default dims" begin
for x in (randn(3), randn(3, 4), randn(3, 4, 5))
N = ndims(x)
complex_x = complex.(x)
@test fft(x) fft(x, 1:N)
@test ifft(x) ifft(x, 1:N)
@test bfft(x) bfft(x, 1:N)
@test rfft(x) rfft(x, 1:N)
d = 2 * size(x, 1) - 1
@test irfft(x, d) irfft(x, d, 1:N)
@test brfft(x, d) brfft(x, d, 1:N)
end
end

@testset "ChainRules" begin
@testset "shift functions" begin
for x in (randn(3), randn(3, 4), randn(3, 4, 5))
Expand Down

0 comments on commit 20de5e7

Please sign in to comment.