verifications_test.go 483 B

1234567891011121314151617181920
  1. package fsm
  2. import (
  3. "testing"
  4. )
  5. func TestIsFSMContextCancellable(t *testing.T) {
  6. /* Example case:
  7. ctx := context.TODO()
  8. ctx, can := context.WithCancel(ctx)
  9. fmt.Fprintln(io.Discard, can)
  10. ctx, canD := context.WithDeadline(ctx, time.Now().Add(time.Minute))
  11. fmt.Fprintln(io.Discard, canD)
  12. ctx = context.WithoutCancel(ctx)
  13. ctx, canT := context.WithTimeout(ctx, time.Minute)
  14. fmt.Fprintln(io.Discard, canT)
  15. sCtx, ok := ctx.(fmt.Stringer)
  16. fmt.Println(sCtx.String(), ok)
  17. */
  18. }