This commit is contained in:
2025-03-25 23:00:10 +08:00
parent a89bec24e9
commit a09362480a
3 changed files with 49 additions and 0 deletions

19
tests/test_3427.cpp Normal file
View File

@@ -0,0 +1,19 @@
//
// Created by xfj12 on 2025/3/25.
//
#include <gtest/gtest.h>
#include <solution/3427.h>
TEST(SubarraySumTest, Test1)
{
int nums[] = {2, 3, 1};
int result = subarraySum(nums, 3);
EXPECT_EQ(result, 11);
}
TEST(SubarraySumTest, Test2)
{
int nums[] = {3, 1, 1, 2};
int result = subarraySum(nums, 4);
EXPECT_EQ(result, 13);
}