Skip to content

Commit c63d8f9

Browse files
committed
add fix for tests
1 parent 9ed0b03 commit c63d8f9

File tree

6 files changed

+14560
-24
lines changed

6 files changed

+14560
-24
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tests/tracer.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ fn smoke() {
174174
[10] 5 : Running(cursor=0,len=2,prev_cursor=1)
175175
[10] 7 : Running(cursor=0,len=2)
176176
[10] 8 : Success(key=&tick,expected=10)
177-
[10] 7 : Success(cursor=0,len=2)
178-
[10] 5 : Success(cursor=1,len=2,prev_cursor=1)
179-
[10] 2 : Success(cursor=2,len=3)
177+
[10] 7 : Success(cursor=0,len=2,prev_cursor=0)
178+
[10] 5 : Success(cursor=1,len=2,prev_cursor=0)
179+
[10] 2 : Success(cursor=2,len=3,prev_cursor=0)
180180
[10] 1 : Running(cursor=0,len=1)
181181
[10] 1 : Success(cursor=0,len=1)
182182
"#
@@ -221,25 +221,24 @@ fn custom_state() {
221221
assert_eq!(
222222
trace,
223223
r#"[1] 1 : Running(cursor=0,len=1)
224-
[1] 2 : Running(len=1)
224+
[1] 2 : Running(attempt=1,cursor=0,len=1)
225225
[1] custom: i = 0
226226
[1] 3 : Success()
227-
[1] 2 : Running(arg=2,cursor=0,len=1)
227+
[1] 2 : Running(attempt=2,cursor=0,len=1)
228228
[2] next tick
229-
[2] 2 : Running(arg=2,cursor=0,len=1)
229+
[2] 2 : Running(attempt=2,cursor=0,len=1)
230230
[2] custom: i = 1
231231
[2] 3 : Success()
232-
[2] 2 : Running(arg=3,cursor=0,len=1)
232+
[2] 2 : Running(attempt=3,cursor=0,len=1)
233233
[2] 1 : Running(cursor=0,len=1)
234234
[3] next tick
235-
[3] 2 : Running(arg=3,cursor=0,len=1)
235+
[3] 2 : Running(attempt=3,cursor=0,len=1)
236236
[3] custom: i = 2
237237
[3] 3 : Success()
238-
[3] 2 : Success(arg=3,cursor=0,len=1)
238+
[3] 2 : Success(attempt=3,cursor=0,len=1)
239239
[3] 1 : Running(cursor=0,len=1)
240240
[3] 1 : Success(cursor=0,len=1)
241-
"#
242-
.replace("\n", tracer::LINE_ENDING)
241+
"#.replace("\n", tracer::LINE_ENDING)
243242
)
244243
}
245244

@@ -292,24 +291,23 @@ fn file() {
292291
assert_eq!(
293292
file_trace,
294293
r#"[1] 1 : Running(cursor=0,len=1)
295-
[1] 2 : Running(len=1)
294+
[1] 2 : Running(attempt=1,cursor=0,len=1)
296295
[1] custom: i = 0
297296
[1] 3 : Success()
298-
[1] 2 : Running(arg=2,cursor=0,len=1)
297+
[1] 2 : Running(attempt=2,cursor=0,len=1)
299298
[2] next tick
300-
[2] 2 : Running(arg=2,cursor=0,len=1)
299+
[2] 2 : Running(attempt=2,cursor=0,len=1)
301300
[2] custom: i = 1
302301
[2] 3 : Success()
303-
[2] 2 : Running(arg=3,cursor=0,len=1)
302+
[2] 2 : Running(attempt=3,cursor=0,len=1)
304303
[2] 1 : Running(cursor=0,len=1)
305304
[3] next tick
306-
[3] 2 : Running(arg=3,cursor=0,len=1)
305+
[3] 2 : Running(attempt=3,cursor=0,len=1)
307306
[3] custom: i = 2
308307
[3] 3 : Success()
309-
[3] 2 : Success(arg=3,cursor=0,len=1)
308+
[3] 2 : Success(attempt=3,cursor=0,len=1)
310309
[3] 1 : Running(cursor=0,len=1)
311310
[3] 1 : Success(cursor=0,len=1)
312-
"#
313-
.replace("\n", tracer::LINE_ENDING)
311+
"# .replace("\n", tracer::LINE_ENDING)
314312
);
315313
}

src/tracer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ mod tests {
337337

338338
let res = tracer.to_string();
339339
assert_eq!(
340-
res,
340+
res.replace("\r\n", "\n"),
341341
r#"[1]next tick
342342
[2]1 : Success()
343343
"#

tree/tests/simulator/smoke/sim_absolute_t.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
config:
2-
trace: C:\Users\zhguc\projects\forester\tree\tests\simulator\smoke\gen\main.log
3-
graph: C:\Users\zhguc\projects\forester\tree/tests\simulator\smoke\gen\main.svg
2+
trace: C:\Users\zhguc\projects\forester\tree/tests\simulator/smoke/gen\main.log
3+
graph: C:\Users\zhguc\projects\forester\tree/tests\simulator/smoke/gen\main.svg
44
bb:
5-
dump: C:\Users\zhguc\projects\forester\tree\tests\simulator\smoke\gen\bb.json
5+
dump: C:\Users\zhguc\projects\forester\tree/tests\simulator/smoke/gen\bb.json
66
max_ticks: 10
77

88
actions:

tree/tests/trimmer/naive/main.log

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,58 @@
161161
[1] 3 : Success(cursor=1,len=3)
162162
[1] 2 : Success(cursor=0,len=1)
163163
[1] 1 : Success(cursor=0,len=1)
164+
[1] 1 : Running(cursor=0,len=1)
165+
[1] 2 : Running(cursor=0,len=1)
166+
[1] 3 : Running(cursor=0,len=3)
167+
[1] 4 : Success(item=[x:1,y:1])
168+
[1] 3 : Success(cursor=0,len=3,prev_cursor=0)
169+
[1] 2 : Success(cursor=0,len=1,prev_cursor=0)
170+
[1] 1 : Success(cursor=0,len=1)
171+
[1] 1 : Running(cursor=0,len=1)
172+
[1] 2 : Running(cursor=0,len=1)
173+
[1] 3 : Running(cursor=0,len=3)
174+
[1] 4 : Failure(item=[y:1,x:1],reason=)
175+
[1] 3 : Running(cursor=1,len=3)
176+
[1] 5 : Success()
177+
[1] 3 : Success(cursor=1,len=3,prev_cursor=0)
178+
[1] 2 : Success(cursor=0,len=1,prev_cursor=0)
179+
[1] 1 : Success(cursor=0,len=1)
180+
[1] 1 : Running(cursor=0,len=1)
181+
[1] 2 : Running(cursor=0,len=1)
182+
[1] 3 : Running(cursor=0,len=3)
183+
[1] 4 : Success(item=[y:1,x:1])
184+
[1] 3 : Success(cursor=0,len=3,prev_cursor=0)
185+
[1] 2 : Success(cursor=0,len=1,prev_cursor=0)
186+
[1] 1 : Success(cursor=0,len=1)
187+
[1] 1 : Running(cursor=0,len=1)
188+
[1] 2 : Running(cursor=0,len=1)
189+
[1] 3 : Running(cursor=0,len=3)
190+
[1] 4 : Success(item=[y:1,x:1])
191+
[1] 3 : Success(cursor=0,len=3,prev_cursor=0)
192+
[1] 2 : Success(cursor=0,len=1,prev_cursor=0)
193+
[1] 1 : Success(cursor=0,len=1)
194+
[1] 1 : Running(cursor=0,len=1)
195+
[1] 2 : Running(cursor=0,len=1)
196+
[1] 3 : Running(cursor=0,len=3)
197+
[1] 4 : Success(item=[y:1,x:1])
198+
[1] 3 : Success(cursor=0,len=3,prev_cursor=0)
199+
[1] 2 : Success(cursor=0,len=1,prev_cursor=0)
200+
[1] 1 : Success(cursor=0,len=1)
201+
[1] 1 : Running(cursor=0,len=1)
202+
[1] 2 : Running(cursor=0,len=1)
203+
[1] 3 : Running(cursor=0,len=3)
204+
[1] 4 : Failure(item=[x:1,y:1],reason=)
205+
[1] 3 : Running(cursor=1,len=3)
206+
[1] 5 : Success()
207+
[1] 3 : Success(cursor=1,len=3,prev_cursor=0)
208+
[1] 2 : Success(cursor=0,len=1,prev_cursor=0)
209+
[1] 1 : Success(cursor=0,len=1)
210+
[1] 1 : Running(cursor=0,len=1)
211+
[1] 2 : Running(cursor=0,len=1)
212+
[1] 3 : Running(cursor=0,len=3)
213+
[1] 4 : Failure(item=[x:1,y:1],reason=)
214+
[1] 3 : Running(cursor=1,len=3)
215+
[1] 5 : Success()
216+
[1] 3 : Success(cursor=1,len=3,prev_cursor=0)
217+
[1] 2 : Success(cursor=0,len=1,prev_cursor=0)
218+
[1] 1 : Success(cursor=0,len=1)

0 commit comments

Comments
 (0)