@@ -42,7 +42,7 @@ mod tests {
42
42
43
43
// Get the first chunk.
44
44
let chunk = stream. next ( ) . await . expect ( "Should receive data" ) ?;
45
- println ! ( "chunk: {:?}" , chunk) ;
45
+ println ! ( "chunk 1 : {:?}" , chunk) ;
46
46
assert_eq ! ( chunk. line, test_content) ;
47
47
48
48
// Write more content to the file.
@@ -52,7 +52,7 @@ mod tests {
52
52
53
53
// Get the second chunk.
54
54
let chunk = stream. next ( ) . await ;
55
- println ! ( "chunk: {:?}" , chunk) ;
55
+ println ! ( "chunk 2 : {:?}" , chunk) ;
56
56
match chunk {
57
57
Some ( chunk) => match chunk {
58
58
Ok ( chunk) => assert_eq ! ( chunk. line, more_content) ,
@@ -102,7 +102,7 @@ mod tests {
102
102
103
103
// Get the first chunk
104
104
let chunk = stream. next ( ) . await . expect ( "Should receive data" ) ?;
105
- println ! ( "chunk: {:?}" , chunk) ;
105
+ println ! ( "chunk 1 : {:?}" , chunk) ;
106
106
assert_eq ! ( chunk. line, "Initial content" ) ;
107
107
108
108
// Simulate log rotation - delete and recreate file
@@ -124,7 +124,7 @@ mod tests {
124
124
// Get the content after rotation
125
125
let chunk =
126
126
stream. next ( ) . await . expect ( "Should receive rotated data" ) ?;
127
- println ! ( "chunk: {:?}" , chunk) ;
127
+ println ! ( "chunk 2 : {:?}" , chunk) ;
128
128
assert_eq ! ( chunk. line, "Rotated content" ) ;
129
129
130
130
// Stop watching
@@ -156,7 +156,7 @@ mod tests {
156
156
157
157
// Get the first chunk.
158
158
let chunk = stream. next ( ) . await . expect ( "Should receive data" ) ?;
159
- println ! ( "chunk: {:?}" , chunk) ;
159
+ println ! ( "chunk 1 : {:?}" , chunk) ;
160
160
assert_eq ! ( chunk. line, "Test content" ) ;
161
161
162
162
// Wait for the timeout to occur (no new content being written).
@@ -195,16 +195,15 @@ mod tests {
195
195
\" msgpack://127.0.0.1:8001/\" , \" graph name\" : \" \" , \" graph \
196
196
id\" : \" 38097178-1712-4562-b60d-8e6ab15ba0cf\" , \
197
197
\" extension_threads\" : {\" 1713045\" : {\" extensions\" : \
198
- [\" test_extension\" ]}}}";
198
+ [\" test_extension\" ]}}}\n ";
199
199
200
200
temp_file. write_all ( graph_resources_with_thread. as_bytes ( ) ) ?;
201
- temp_file. write_all ( b"\n " ) ?;
202
201
temp_file. flush ( ) ?;
203
202
204
203
// Get the graph resources line
205
204
let chunk =
206
205
stream. next ( ) . await . expect ( "Should receive graph resources" ) ?;
207
- println ! ( "chunk: {:?}" , chunk) ;
206
+ println ! ( "chunk 1 : {:?}" , chunk) ;
208
207
assert ! ( chunk. line. contains( "[graph resources]" ) ) ;
209
208
210
209
// Now write logs that contain extension metadata in format
@@ -225,27 +224,27 @@ mod tests {
225
224
. next ( )
226
225
. await
227
226
. expect ( "Should receive log with extension" ) ?;
228
- println ! ( "chunk: {:?}" , chunk) ;
227
+ println ! ( "chunk 2 : {:?}" , chunk) ;
229
228
assert ! ( chunk. line. contains( "on_start()" ) ) ;
230
229
231
230
// The metadata should include the extension name
232
231
assert ! ( chunk. metadata. is_some( ) , "Should have metadata" ) ;
233
232
let metadata = chunk. metadata . unwrap ( ) ;
234
- println ! ( "metadata: {:?}" , metadata) ;
233
+ println ! ( "metadata 2 : {:?}" , metadata) ;
235
234
assert_eq ! ( metadata. extension, Some ( "test_extension" . to_string( ) ) ) ;
236
235
237
236
// Get second log with extension metadata
238
237
let chunk = stream
239
238
. next ( )
240
239
. await
241
240
. expect ( "Should receive log with extension" ) ?;
242
- println ! ( "chunk: {:?}" , chunk) ;
241
+ println ! ( "chunk 3 : {:?}" , chunk) ;
243
242
assert ! ( chunk. line. contains( "on_start() done" ) ) ;
244
243
245
244
// The metadata should include the extension name
246
245
assert ! ( chunk. metadata. is_some( ) , "Should have metadata" ) ;
247
246
let metadata = chunk. metadata . unwrap ( ) ;
248
- println ! ( "metadata: {:?}" , metadata) ;
247
+ println ! ( "metadata 3 : {:?}" , metadata) ;
249
248
assert_eq ! ( metadata. extension, Some ( "test_extension" . to_string( ) ) ) ;
250
249
251
250
// Stop watching
@@ -376,10 +375,9 @@ mod tests {
376
375
05-02 22:23:37.535 1713000(1713002) D \
377
376
ten_protocol_integrated_on_close@close.c:107 \
378
377
[2b11c6a8-9a63-4e9e-b18a-92456dee49d5] Integrated protocol \
379
- can be closed now";
378
+ can be closed now\n ";
380
379
381
380
temp_file. write_all ( complete_log. as_bytes ( ) ) ?;
382
- temp_file. write_all ( b"\n " ) ?;
383
381
temp_file. flush ( ) ?;
384
382
385
383
// We need to iterate through all log lines to find the specific
@@ -395,6 +393,7 @@ mod tests {
395
393
// Process all log lines
396
394
while let Some ( result) = stream. next ( ) . await {
397
395
let chunk = result?;
396
+ println ! ( "chunk: {:?}" , chunk) ;
398
397
399
398
// Check if this is one of our target lines
400
399
if chunk. line . contains ( target_start_line)
0 commit comments