2716
This commit is contained in:
34
tests/test_2716.cpp
Normal file
34
tests/test_2716.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <solution/2716.h>
|
||||
|
||||
// 测试用例 1
|
||||
TEST(MinimizedStringLengthTest, Test1)
|
||||
{
|
||||
char s[] = "aaabc";
|
||||
int expected = 3;
|
||||
EXPECT_EQ(minimizedStringLength(s), expected);
|
||||
}
|
||||
|
||||
// 测试用例 2
|
||||
TEST(MinimizedStringLengthTest, Test2)
|
||||
{
|
||||
char s[] = "cbbd";
|
||||
int expected = 3;
|
||||
EXPECT_EQ(minimizedStringLength(s), expected);
|
||||
}
|
||||
|
||||
// 测试用例 3
|
||||
TEST(MinimizedStringLengthTest, Test3)
|
||||
{
|
||||
char s[] = "dddaaa";
|
||||
int expected = 2;
|
||||
EXPECT_EQ(minimizedStringLength(s), expected);
|
||||
}
|
||||
|
||||
// 测试用例 4
|
||||
TEST(MinimizedStringLengthTest, Test4)
|
||||
{
|
||||
char s[] = "baadccab";
|
||||
int expected = 4;
|
||||
EXPECT_EQ(minimizedStringLength(s), expected);
|
||||
}
|
||||
Reference in New Issue
Block a user