1234567891011121314151617181920 |
- package fsm
- import (
- "testing"
- )
- func TestIsFSMContextCancellable(t *testing.T) {
- /* Example case:
- ctx := context.TODO()
- ctx, can := context.WithCancel(ctx)
- fmt.Fprintln(io.Discard, can)
- ctx, canD := context.WithDeadline(ctx, time.Now().Add(time.Minute))
- fmt.Fprintln(io.Discard, canD)
- ctx = context.WithoutCancel(ctx)
- ctx, canT := context.WithTimeout(ctx, time.Minute)
- fmt.Fprintln(io.Discard, canT)
- sCtx, ok := ctx.(fmt.Stringer)
- fmt.Println(sCtx.String(), ok)
- */
- }
|