@@ -45,8 +45,8 @@ using ::testing::MatchesRegex;
45
45
// `contents`.
46
46
MATCHER_P2 (IsPrintedAs, proto_name, contents, " " ) {
47
47
// NOLINTNEXTLINE(whitespace/braces)
48
- std::string header = std::string{" <" } + proto_name + " 0x[0-9A-Fa-f]+>: {" ;
49
- std::string expected = header + contents + " }" ;
48
+ std::string header = std::string{" <" } + proto_name + " 0x[0-9A-Fa-f]+>: \\ {" ;
49
+ std::string expected = header + contents + " \\ }" ;
50
50
return testing::Value (arg, MatchesRegex (expected));
51
51
}
52
52
@@ -102,10 +102,10 @@ TEST(PrettyPrintingTest, PrintsSubmessages) {
102
102
m->snapshot_version .nanos = 456 ;
103
103
104
104
EXPECT_THAT (m.ToString (), IsPrintedAs (" Target" , R"(
105
- snapshot_version {
105
+ snapshot_version \ {
106
106
seconds: 123
107
107
nanos: 456
108
- }
108
+ \ }
109
109
)" ));
110
110
}
111
111
@@ -136,14 +136,14 @@ TEST(PrettyPrintingTest, PrintsArraysOfObjects) {
136
136
m->labels [1 ].value = MakeBytesArray (" value2" );
137
137
138
138
EXPECT_THAT (m.ToString (), IsPrintedAs (" ListenRequest" , R"(
139
- labels {
139
+ labels \ {
140
140
key: "key1"
141
141
value: "value1"
142
- }
143
- labels {
142
+ \ }
143
+ labels \ {
144
144
key: "key2"
145
145
value: "value2"
146
- }
146
+ \ }
147
147
)" ));
148
148
}
149
149
@@ -182,22 +182,22 @@ TEST(PrettyPrintingTest, PrintsMessagesInOneofs) {
182
182
google_firestore_v1_Value_timestamp_value_tag;
183
183
184
184
EXPECT_THAT (m.ToString (), IsPrintedAs (" Write" , R"(
185
- update {
185
+ update \ {
186
186
name: "some name"
187
- fields {
187
+ fields \ {
188
188
key: "key1"
189
- value {
189
+ value \ {
190
190
boolean_value: false
191
- }
192
- }
193
- fields {
191
+ \ }
192
+ \ }
193
+ fields \ {
194
194
key: "key2"
195
- value {
196
- timestamp_value {
197
- }
198
- }
199
- }
200
- }
195
+ value \ {
196
+ timestamp_value \ {
197
+ \ }
198
+ \ }
199
+ \ }
200
+ \ }
201
201
)" ));
202
202
}
203
203
@@ -209,10 +209,10 @@ TEST(PrettyPrintingTest, PrintsNonAnonymousOneofs) {
209
209
m->consistency_selector .read_time .seconds = 123 ;
210
210
m->consistency_selector .read_time .nanos = 456 ;
211
211
EXPECT_THAT (m.ToString (), IsPrintedAs (" RunQueryRequest" , R"(
212
- read_time {
212
+ read_time \ {
213
213
seconds: 123
214
214
nanos: 456
215
- }
215
+ \ }
216
216
)" ));
217
217
}
218
218
@@ -232,10 +232,10 @@ TEST(PrettyPrintingTest, PrintsOptionals) {
232
232
233
233
m->has_update_mask = true ;
234
234
EXPECT_THAT (m.ToString (), IsPrintedAs (" Write" , R"(
235
- update_mask {
235
+ update_mask \ {
236
236
field_paths: "abc"
237
237
field_paths: "def"
238
- }
238
+ \ }
239
239
)" ));
240
240
}
241
241
@@ -246,8 +246,8 @@ TEST(PrettyPrintingTest, PrintsEmptyOptionals) {
246
246
// When set, an optional submessage should always be printed, even if it's
247
247
// "empty".
248
248
EXPECT_THAT (m.ToString (), IsPrintedAs (" Write" , R"(
249
- update_mask {
250
- }
249
+ update_mask \ {
250
+ \ }
251
251
)" ));
252
252
}
253
253
0 commit comments