We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e319a2 commit 025ace3Copy full SHA for 025ace3
1 file changed
test/csum.cpp
@@ -1,6 +1,7 @@
1
2
#include "../csum.hpp"
3
#include <gtest/gtest.h>
4
+#include <string>
5
6
using namespace algocpp::numeric;
7
@@ -9,3 +10,13 @@ TEST(numeric_csum, nomal)
9
10
int a = 334;
11
EXPECT_EQ(csum(a), 10);
12
}
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