-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcodspeed.cpp
More file actions
53 lines (43 loc) · 2.19 KB
/
Copy pathcodspeed.cpp
File metadata and controls
53 lines (43 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "codspeed.h"
#include <gtest/gtest.h>
// Manual definition (to avoid including it in the public header):
TEST(CodSpeedTest, TestSearchAndReplaceBetweenBracketsNamespace) {
std::string no_brackets_input =
"examples/google_benchmark/main.cpp::BM_rand_vector";
std::string no_brackets_output =
"examples/google_benchmark/main.cpp::BM_rand_vector";
EXPECT_EQ(codspeed::sanitize_bench_args(no_brackets_input),
no_brackets_output);
std::string brackets_and_no_escaped_type_input =
"examples/google_benchmark/"
"template_bench.hpp::BM_Template1_Capture[two_type_test, int, double]";
std::string brackets_and_no_escaped_type_output =
"examples/google_benchmark/"
"template_bench.hpp::BM_Template1_Capture[two_type_test, int, double]";
EXPECT_EQ(codspeed::sanitize_bench_args(brackets_and_no_escaped_type_input),
brackets_and_no_escaped_type_output);
std::string brackets_and_escaped_type_input =
"examples/google_benchmark/"
"template_bench.hpp::test::BM_Template[std::string]";
std::string brackets_and_escaped_type_output =
"examples/google_benchmark/"
"template_bench.hpp::test::BM_Template[std\\:\\:string]";
EXPECT_EQ(codspeed::sanitize_bench_args(brackets_and_escaped_type_input),
brackets_and_escaped_type_output);
std::string brackets_and_escaped_types_input =
"examples/google_benchmark/"
"template_bench.hpp::test::BM_Template[std::string, std::string]";
std::string brackets_and_escaped_types_output =
"examples/google_benchmark/"
"template_bench.hpp::test::BM_Template[std\\:\\:string, std\\:\\:string]";
EXPECT_EQ(codspeed::sanitize_bench_args(brackets_and_escaped_types_input),
brackets_and_escaped_types_output);
std::string brackets_and_multiple_types_input =
"examples/google_benchmark/"
"template_bench.hpp::test::BM_Template[std::string, int, double]";
std::string brackets_and_multiple_types_output =
"examples/google_benchmark/"
"template_bench.hpp::test::BM_Template[std\\:\\:string, int, double]";
EXPECT_EQ(codspeed::sanitize_bench_args(brackets_and_multiple_types_input),
brackets_and_multiple_types_output);
}