ladybird/Tests/AK/TestIntegerMath.cpp
2022-02-06 17:52:33 +00:00

21 lines
502 B
C++

/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibTest/TestCase.h>
#include <AK/IntegralMath.h>
TEST_CASE(pow)
{
EXPECT_EQ(AK::pow<u64>(10, 0), 1ull);
EXPECT_EQ(AK::pow<u64>(10, 1), 10ull);
EXPECT_EQ(AK::pow<u64>(10, 2), 100ull);
EXPECT_EQ(AK::pow<u64>(10, 3), 1'000ull);
EXPECT_EQ(AK::pow<u64>(10, 4), 10'000ull);
EXPECT_EQ(AK::pow<u64>(10, 5), 100'000ull);
EXPECT_EQ(AK::pow<u64>(10, 6), 1'000'000ull);
}