
# Feynman and Hibbs, page 319.
athermal_values = [
    [3.00, 5.00, 7.00, 9.00, 11.00],
    [3.44, 4.02, 5.81, 9.85, 15.5],
    [2.55, 2.13, 1.6, 1.28, 1.15]
]

# Hellwarth & Biaggio (1999) data. Table 3. [α, β, [(v, w)...]]
thermal_values = [
    [1.0, 2.0, 3.0, 4.0, 5.0],
    [1.00, 1.25, 1.50, 1.75, 2.00, 2.50, 2.75, 3.00],
    [
        [(7.20, 6.50), (5.94, 5.31), (5.11, 4.54), (4.54, 4.01), (4.12, 3.63), (3.57, 3.13), (3.38, 2.97), (3.24, 2.84)],
        [(7.69, 6.20), (6.38, 5.03), (5.52, 4.29), (4.92, 3.77), (4.48, 3.40), (3.89, 2.93), (3.69, 2.77), (3.53, 2.65)],
        [(8.26, 5.87), (6.91, 4.73), (6.02, 4.01), (5.40, 3.51), (4.94, 3.16), (4.32, 2.70), (4.10, 2.55), (3.93, 2.44)],
        [(8.95, 5.51), (7.57, 4.41), (6.66, 3.70), (6.02, 3.22), (5.54, 2.88), (4.90, 2.45), (4.67, 2.31), (4.48, 2.21)],
        [(9.78, 5.13), (8.39, 4.05), (7.48, 3.37), (6.84, 2.92), (6.36, 2.60), (5.71, 2.20), (5.48, 2.07), (5.29, 1.97)]
    ]
]

@testset "variation" begin

    @testset "athermal" begin
        for (α, v, w) in zip(athermal_values...)
            @test all(all.(map((i,j) -> isapprox.(i,j, atol = 0.1), variation(α), (v, w))))
        end
    end

    @testset "thermal" begin
        for (α, vw) in zip(thermal_values[1], thermal_values[3])
            for (β, p) in zip(thermal_values[2], vw)
                @test all(all.(map((i,j) -> isapprox.(i,j, atol = 0.01), variation(α, β), p)))
            end
        end
    end
end
