// Port of de.varylab.discreteconformal.functional.ClausenTest (Java/JUnit).
// Reference values computed with Mathematica.

#include "clausen.hpp"

#include <gtest/gtest.h>
#include <complex>

using conformallab::ImLi2;
using C = std::complex<double>;

TEST(ClausenTest, ImLi2_case1) {
    double r = ImLi2(C(0.5, 0.5));
    EXPECT_NEAR(0.643767332889268748742017, r, 1e-15);
}

TEST(ClausenTest, ImLi2_case2) {
    double r = ImLi2(C(1.234, -3.554));
    EXPECT_NEAR(-2.784709023190200241929031, r, 1e-15);
}

TEST(ClausenTest, ImLi2_case3) {
    double r = ImLi2(C(-4.254, 2.965));
    EXPECT_NEAR(1.104092479314665907914598, r, 1e-15);
}

TEST(ClausenTest, ImLi2_case4) {
    double r = ImLi2(C(-2.264, -1.05));
    EXPECT_NEAR(-0.540683148040955780529547, r, 1e-15);
}

TEST(ClausenTest, ImLi2_case5) {
    double r = ImLi2(C(-4.0, 2.0));
    EXPECT_NEAR(0.7855694340809751306351005, r, 1e-15);
}
