Commit 886fdce3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 2855a6d5
...@@ -790,30 +790,34 @@ func Verify(t testing.TB, f func(t *T)) { ...@@ -790,30 +790,34 @@ func Verify(t testing.TB, f func(t *T)) {
tT := &T{_testing_TB: t, streamTab: make(map[string]Chan)} tT := &T{_testing_TB: t, streamTab: make(map[string]Chan)}
// XXX // XXX
// verify in the end that no events are left unchecked / unconsumed, func() {
// e.g. sent to RxEvent, but not received. Nak them if they are and fail. // verify in the end that no events are left unchecked / unconsumed,
// // e.g. sent to RxEvent, but not received. Nak them if they are and fail.
// NOTE this complements T.Fatal and friends, because a test might //
// think it completes successfully, but leaves unconsumed events behind it. // NOTE this complements T.Fatal and friends, because a test might
defer func() { // think it completes successfully, but leaves unconsumed events behind it.
nnak := tT.closeStreamTab() defer func() {
if nnak != 0 { nnak := tT.closeStreamTab()
t.Fatal() if nnak != 0 {
} t.Fatal()
}
}()
f(tT)
}() }()
f(tT) // now, if f succeeds, verify f with injected delays.
if tT.Failed() {
return
}
/*
// now verify f with injected delays.
trace0 := tT.tracev trace0 := tT.tracev
// sort trace0 by time just in case - events migth come from multiple // sort trace0 by time just in case - events migth come from multiple
// CPUs simultaneously, and so for close events they might be added to // CPUs simultaneously, and so for close events they might be added to
// tracev not in time order. // tracev not in time order.
sort.Slice(trace0, func(i, j int) bool { sort.Slice(trace0, func(i, j int) bool {
return trace0[i].t.Before(trace[j].t) return trace0[i].t.Before(trace0[j].t)
} })
*/
// XXX in the end: verify that streams are the same from run to run (if completed successfully). // XXX in the end: verify that streams are the same from run to run (if completed successfully).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment