Skip to content

Commit e2aef58

Browse files
committed
fix lint
1 parent 8ce8d39 commit e2aef58

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

tests/unit/src/parser.cpp

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "../../../src/tml/parser.hpp"
99

1010
namespace{
11-
enum action_enum{
11+
enum class action_enum{
1212
children_start,
1313
children_end,
1414
string_item
@@ -20,14 +20,14 @@ class test_listener : public tml::listener{
2020
void on_children_parse_finished(tml::location)override{
2121
// TRACE(<< "}" << std::endl)
2222
tst::check(this->actions.size() > 0, SL);
23-
tst::check(this->actions.front().first == children_end, SL) << "first = " << this->actions.front().first << " second = " << this->actions.front().second;
23+
tst::check(this->actions.front().first == action_enum::children_end, SL) << "first = " << unsigned(this->actions.front().first) << " second = " << this->actions.front().second;
2424
this->actions.pop_front();
2525
}
2626

2727
void on_children_parse_started(tml::location)override{
2828
// TRACE(<< "{" << std::endl)
2929
tst::check(this->actions.size() > 0, SL);
30-
tst::check(this->actions.front().first == children_start, SL) << "first = " << this->actions.front().first << " second = " << this->actions.front().second;
30+
tst::check(this->actions.front().first == action_enum::children_start, SL) << "first = " << unsigned(this->actions.front().first) << " second = " << this->actions.front().second;
3131
this->actions.pop_front();
3232
}
3333

@@ -38,13 +38,13 @@ class test_listener : public tml::listener{
3838
// o << " line = " << info.location.line << '\n';
3939
// });
4040
tst::check(this->actions.size() > 0, SL);
41-
tst::check(this->actions.front().first == string_item, [&](auto&o){
42-
o << "first = " << this->actions.front().first;
41+
tst::check(this->actions.front().first == action_enum::string_item, [&](auto&o){
42+
o << "first = " << unsigned(this->actions.front().first);
4343
o << " second = " << this->actions.front().second;
4444
o << " line = " << info.location.line;
4545
}, SL);
4646
tst::check(this->actions.front().second == str, [&](auto&o){
47-
o << "first = " << this->actions.front().first;
47+
o << "first = " << unsigned(this->actions.front().first);
4848
o << " second = " << this->actions.front().second;
4949
o << " str = " << str;
5050
}, SL);
@@ -71,64 +71,64 @@ const tst::set set("parser", [](auto& suite){
7171
suite.add("parse", [](){
7272
test_listener l;
7373

74-
l.actions.emplace_back(string_item, "test string");
75-
l.actions.emplace_back(string_item, "another string");
76-
l.actions.emplace_back(string_item, "unquotedString");
74+
l.actions.emplace_back(action_enum::string_item, "test string");
75+
l.actions.emplace_back(action_enum::string_item, "another string");
76+
l.actions.emplace_back(action_enum::string_item, "unquotedString");
7777

78-
l.actions.emplace_back(string_item, "string with empty children list");
79-
l.actions.emplace_back(children_start, "");
80-
l.actions.emplace_back(children_end, "");
78+
l.actions.emplace_back(action_enum::string_item, "string with empty children list");
79+
l.actions.emplace_back(action_enum::children_start, "");
80+
l.actions.emplace_back(action_enum::children_end, "");
8181

82-
l.actions.emplace_back(string_item, "unquoted_string_with_empty_children_list");
83-
l.actions.emplace_back(children_start, "");
84-
l.actions.emplace_back(children_end, "");
82+
l.actions.emplace_back(action_enum::string_item, "unquoted_string_with_empty_children_list");
83+
l.actions.emplace_back(action_enum::children_start, "");
84+
l.actions.emplace_back(action_enum::children_end, "");
8585

86-
l.actions.emplace_back(string_item, "");
87-
l.actions.emplace_back(children_start, "");
88-
l.actions.emplace_back(children_end, "");
86+
l.actions.emplace_back(action_enum::string_item, "");
87+
l.actions.emplace_back(action_enum::children_start, "");
88+
l.actions.emplace_back(action_enum::children_end, "");
8989

90-
l.actions.emplace_back(string_item, "");
91-
l.actions.emplace_back(children_start, "");
90+
l.actions.emplace_back(action_enum::string_item, "");
91+
l.actions.emplace_back(action_enum::children_start, "");
9292

93-
l.actions.emplace_back(string_item, "");
94-
l.actions.emplace_back(children_start, "");
95-
l.actions.emplace_back(children_end, "");
93+
l.actions.emplace_back(action_enum::string_item, "");
94+
l.actions.emplace_back(action_enum::children_start, "");
95+
l.actions.emplace_back(action_enum::children_end, "");
9696

97-
l.actions.emplace_back(string_item, "");
98-
l.actions.emplace_back(children_start, "");
99-
l.actions.emplace_back(children_end, "");
97+
l.actions.emplace_back(action_enum::string_item, "");
98+
l.actions.emplace_back(action_enum::children_start, "");
99+
l.actions.emplace_back(action_enum::children_end, "");
100100

101-
l.actions.emplace_back(children_end, "");
101+
l.actions.emplace_back(action_enum::children_end, "");
102102

103-
l.actions.emplace_back(string_item, "");
104-
l.actions.emplace_back(children_start, "");
103+
l.actions.emplace_back(action_enum::string_item, "");
104+
l.actions.emplace_back(action_enum::children_start, "");
105105

106-
l.actions.emplace_back(string_item, "child string");
106+
l.actions.emplace_back(action_enum::string_item, "child string");
107107

108-
l.actions.emplace_back(string_item, "aaa");
109-
l.actions.emplace_back(children_start, "");
110-
l.actions.emplace_back(children_end, "");
108+
l.actions.emplace_back(action_enum::string_item, "aaa");
109+
l.actions.emplace_back(action_enum::children_start, "");
110+
l.actions.emplace_back(action_enum::children_end, "");
111111

112-
l.actions.emplace_back(string_item, "bbb");
112+
l.actions.emplace_back(action_enum::string_item, "bbb");
113113

114-
l.actions.emplace_back(string_item, "ccc");
115-
l.actions.emplace_back(children_start, "");
116-
l.actions.emplace_back(string_item, "ddd");
117-
l.actions.emplace_back(children_end, "");
114+
l.actions.emplace_back(action_enum::string_item, "ccc");
115+
l.actions.emplace_back(action_enum::children_start, "");
116+
l.actions.emplace_back(action_enum::string_item, "ddd");
117+
l.actions.emplace_back(action_enum::children_end, "");
118118

119-
l.actions.emplace_back(children_end, "");
119+
l.actions.emplace_back(action_enum::children_end, "");
120120

121-
l.actions.emplace_back(string_item, "Tab\t Backslash\\ Slash/ Doubleslash// Newline\n Doublequotes\" {}{}{}{}");
121+
l.actions.emplace_back(action_enum::string_item, "Tab\t Backslash\\ Slash/ Doubleslash// Newline\n Doublequotes\" {}{}{}{}");
122122

123-
l.actions.emplace_back(string_item, "quoted string with trailing slash /");
123+
l.actions.emplace_back(action_enum::string_item, "quoted string with trailing slash /");
124124

125-
l.actions.emplace_back(string_item, "fff ggg");
125+
l.actions.emplace_back(action_enum::string_item, "fff ggg");
126126

127-
l.actions.emplace_back(string_item, "tralala tro lo lo\ntre lele");
127+
l.actions.emplace_back(action_enum::string_item, "tralala tro lo lo\ntre lele");
128128

129-
l.actions.emplace_back(string_item, "-1213.33");
129+
l.actions.emplace_back(action_enum::string_item, "-1213.33");
130130

131-
l.actions.emplace_back(string_item, "UnquotedStringAtTheVeryEndOfTheFile");
131+
l.actions.emplace_back(action_enum::string_item, "UnquotedStringAtTheVeryEndOfTheFile");
132132

133133
papki::fs_file fi("parser_data/test.tml");
134134

0 commit comments

Comments
 (0)