Very simple, just find the formula for the Fourier transform and implement it as a discrete sum over your data values:
given a set of values f(x) for some set of x , then for each frequency k ,
F(k) = sum_x ( exp( +/-i * k *x ) )
select k between 0 and 2*pi / min separation in x .
and you can use 2 * pi / max(x) as the increment size
For the test case, use something for which you know the correct answer, cf, one cos( k' * x ) for some k' or gauss.
source share