#include <gtest/gtest.h>
#include <solution/2163.h>

class MinimumDifferenceTest : public ::testing::Test
{
  protected:
    void AssertMinimumDifference(std::vector<int> input, long long expected)
    {
        long long result = minimumDifference(input.data(), static_cast<int>(input.size()));
        EXPECT_EQ(result, expected);
    }
};

// 示例 1
TEST_F(MinimumDifferenceTest, Example1)
{
    std::vector<int> nums = {3, 1, 2};
    AssertMinimumDifference(nums, -1);
}

// 示例 2
TEST_F(MinimumDifferenceTest, Example2)
{
    std::vector<int> nums = {7, 9, 5, 8, 1, 3};
    AssertMinimumDifference(nums, 1);
}