#include <limits>

#include <gtest/gtest.h>

#include <fesa/core/vec3.hpp>

namespace {

TEST(CoreVec3, ReportsOnlyFiniteVectorsAsFinite) {
    EXPECT_TRUE(fesa::is_finite(fesa::Vec3{1.0, -2.0, 0.0}));

    const double infinity = std::numeric_limits<double>::infinity();
    const double nan = std::numeric_limits<double>::quiet_NaN();

    EXPECT_FALSE(fesa::is_finite(fesa::Vec3{infinity, 0.0, 0.0}));
    EXPECT_FALSE(fesa::is_finite(fesa::Vec3{0.0, -infinity, 0.0}));
    EXPECT_FALSE(fesa::is_finite(fesa::Vec3{0.0, 0.0, nan}));
}

}  // namespace
