Skip to content

Commit 025ace3

Browse files
committed
c
1 parent 3e319a2 commit 025ace3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/csum.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
#include "../csum.hpp"
33
#include <gtest/gtest.h>
4+
#include <string>
45

56
using namespace algocpp::numeric;
67

@@ -9,3 +10,13 @@ TEST(numeric_csum, nomal)
910
int a = 334;
1011
EXPECT_EQ(csum(a), 10);
1112
}
13+
14+
TEST(numeric_csum, string)
15+
{
16+
std::string tmp = "1";
17+
for (int i = 1; i <= 10000; ++i)
18+
{
19+
tmp += "1";
20+
EXPECT_EQ(csum(tmp), i + 1);
21+
}
22+
}

0 commit comments

Comments
 (0)