mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
20 lines
502 B
C++
20 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);
|
|
}
|