// WhenCoverage provides coverage for the When function.
func (t *StringRSuite) WhenCoverage() async.R {
	expected := "a test string"
	w := async.WhenString(async.Done(), func() async.StringR {
		r, s := async.NewStringR()
		s.Complete(expected)
		return r
	})

	// Verify that the value was round-tripped.
	return async.When(w, func(val string, err error) error {
		if err != nil {
			return fmt.Errorf("Expected success.  Got: %v, Want: nil", err)
		}
		if val != expected {
			return fmt.Errorf("Expected value.  Got: %v, Want: %v", val, expected)
		}
		return nil
	})
}
// ForwardCoverage provides coverage for the Forward function.
func (t *StringRSuite) ForwardCoverage() async.R {
	expected := "a test string"
	resolved, s0 := async.NewStringR()
	s0.Complete(expected)

	// Instead of resolving the return result, forward it to an already resolved value.
	w := async.WhenString(async.Done(), func() async.StringR {
		r, s := async.NewStringR()
		s.Forward(resolved)
		return r
	})

	// Verify that the value was round-tripped.
	return async.When(w, func(val string, err error) error {
		if err != nil {
			return fmt.Errorf("Expected success.  Got: %v, Want: nil", err)
		}
		if val != expected {
			return fmt.Errorf("Expected value.  Got: %v, Want: %v", val, expected)
		}
		return nil
	})
}