checkArgs verifies the number of the test command arguments
(args []string, min, max int)
| 958 | |
| 959 | // checkArgs verifies the number of the test command arguments |
| 960 | func (b *bisyncTest) checkArgs(args []string, min, max int) { |
| 961 | cmd := args[0] |
| 962 | num := len(args) - 1 |
| 963 | if min == max && num != min { |
| 964 | b.t.Fatalf("%q must have strictly %d args", cmd, min) |
| 965 | } |
| 966 | if min > 0 && num < min { |
| 967 | b.t.Fatalf("%q must have at least %d args", cmd, min) |
| 968 | } |
| 969 | if max > 0 && num > max { |
| 970 | b.t.Fatalf("%q must have at most %d args", cmd, max) |
| 971 | } |
| 972 | } |
| 973 | |
| 974 | func (b *bisyncTest) checkPreReqs(ctx context.Context, opt *bisync.Options) (context.Context, *bisync.Options) { |
| 975 | // check pre-requisites |