using SynchrotronKernel, Test

@testset "Synchrotron Kernel" begin

    @testset "F" begin
        @test SynchrotronKernel.F(1.e-8) â‰ˆ 0.0046310000727714734
        @test SynchrotronKernel.F(  1.0) â‰ˆ 0.6514228153553652
        @test SynchrotronKernel.F(  3.5) â‰ˆ 0.08268719536694746
        @test SynchrotronKernel.F(  4.5) â‰ˆ 0.03357441971502366
        @test SynchrotronKernel.F( 10.0) â‰ˆ 0.00019223826430086885
        @test SynchrotronKernel.F( 50.0) â‰ˆ 1.734785203976593e-21
        @test SynchrotronKernel.F(100.0) â‰ˆ 4.697593665922202e-43
        @test SynchrotronKernel.F( 1.e6) == 0.0

        @test â„±(1.0) == SynchrotronKernel.F(1.0)
    end
    
    @testset "G" begin
        @test SynchrotronKernel.G(1.0) â‰ˆ 0.4944750621042115

        @test ğ�’¢(1.0) == SynchrotronKernel.G(1.0)
    end

    @testset "Synchrotron Kernel" begin
        K_tot, K_ort, K_par = synchrotron_kernel(1.0)

        @test K_tot == SynchrotronKernel.F(1.0)
        @test K_ort â‰ˆ 0.5729489387297884
        @test K_par â‰ˆ 0.07847387662557684
        @test K_tot == K_ort + K_par
    end

    @testset "Intensity" begin
        @test synchrotron_intensity(1.0) == SynchrotronKernel.F(1.0)
    end

    @testset "Polarisation" begin
        K = SynchrotronKernel.F(1.0)
        sk_ort, sk_par = synchrotron_polarisation(1.0)

        @test sk_ort â‰ˆ 0.5729489387297884
        @test sk_par â‰ˆ 0.07847387662557684
        @test K == sk_ort + sk_par
    end

end