Skip to content

Commit

Permalink
Moved test from unittest to testatement
Browse files Browse the repository at this point in the history
  • Loading branch information
Clonkk committed Oct 26, 2020
1 parent 9e945a2 commit 1c66acd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
tests/test1
testresults/
nimcache/
8 changes: 2 additions & 6 deletions tests/test1.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import unittest
import sugar

import fftw3
Expand All @@ -10,7 +9,7 @@ import random
import times
import system

proc main()=
block: # fftw_plan_dft, fftw_execute_dft
let dims = @[4, 3, 2*7-1]

var randData: Tensor[float64] = randomTensor(dims, 10).astype(float64)
Expand All @@ -35,10 +34,7 @@ proc main()=
let size = complex(orig.size.float64)
orig = orig /. size

test "fftw_plan_dft ifft(fft(x)) compared to original data":
check compare(randData, orig.map(x => x.re))
doAssert compare(randData, orig.map(x => x.re))

fftw_destroy_plan(fft)
fftw_destroy_plan(ifft)

main()

0 comments on commit 1c66acd

Please sign in to comment.