using APCA
using Test
using Random

@testset "APCA.jl" begin
    v= [7.,5.,5.,3.,3.,3.,4.,6.]
    M= 3
    @test runAPCA(v,M) == [6.,6.,3.5,3.5,3.5,3.5,5.,5.]

    Random.seed!(1234)
    v = vcat(rand(10).+3,rand(10).+2,rand(10).-1)
    M = 4
    @test runAPCA(v,M) == [3.1124992225766124, 3.1124992225766124, 3.1124992225766124, 3.1124992225766124,
    3.1124992225766124, 3.1124992225766124, 3.1124992225766124, 3.1124992225766124,
    3.1124992225766124, 3.1124992225766124, 3.1124992225766124, 3.1124992225766124, 3.1124992225766124,
    3.1124992225766124, 3.1124992225766124, 3.1124992225766124, 2.456760310559139, 2.456760310559139, 2.456760310559139,
    2.456760310559139, -0.08728818214843481, -0.08728818214843481, -0.08728818214843481, -0.08728818214843481, -0.7055353573422534,
    -0.7055353573422534, -0.7055353573422534, -0.7055353573422534, -0.7055353573422534, -0.7055353573422534]

end
