-
Notifications
You must be signed in to change notification settings - Fork 10
/
backward.go
33 lines (28 loc) · 1.21 KB
/
backward.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package testcase
import "go.llib.dev/testcase/assert"
// Let is a method to provide backward compatibility with the existing testing suite.
// Due to how Go type parameters work, methods are not allowed to have type parameters,
// thus Let has moved to be a pkg-level function in the package.
//
// DEPRECATED: use testcase.Let instead testcase#Spec.Let.
func (spec *Spec) Let(varName VarID, blk VarInit[any]) Var[any] {
return let[any](spec, varName, blk)
}
// LetValue is a method to provide backward compatibility with the existing testing suite.
// Due to how Go type parameters work, methods are not allowed to have type parameters,
// thus LetValue has moved to be a pkg-level function in the package.
//
// DEPRECATED: use testcase.LetValue instead testcase#Spec.LetValue.
func (spec *Spec) LetValue(varName VarID, value any) Var[any] {
return letValue[any](spec, varName, value)
}
// VarInitFunc is a backward compatibility type for VarInit.
//
// DEPRECATED: use VarInit type instead.
type VarInitFunc[V any] func(*T) V
// RetryStrategyForEventually
//
// DEPRECATED: use testcase.WithRetryStrategy instead
func RetryStrategyForEventually(strategy assert.RetryStrategy) SpecOption {
return WithRetryStrategy(strategy)
}