hashicorp / hashicorp/terraform-plugin-testing

`SizeAtLeast`, `SizeBetween` and `SizeAtMost` for `knownvalue`

Open
#418 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
68
Forks
22
Avg merge
2d 12h
Merged PRs (30d)
1

Description

An example:

```go
{
ConfigStateChecks: []statecheck.StateCheck{
statecheck.ExpectKnownValue(
resourceName,
tfjsonpath.New("some_attr"),
knownvalue.SetSizeAtMost(3),
),
statecheck.ExpectKnownValue(
resourceName,
tfjsonpath.New("some_attr"),
knownvalue.SetSizeAtLeast(1),
),
statecheck.ExpectKnownValue(
resourceName,
tfjsonpath.New("some_attr"),
knownvalue.SetSizeBetween(1, 3),
),
},
}
```

There is only `SetSizeExact` today. Similar stuff can be applied to List and Map. I can put up a PR if you guys can confirm this feature is needed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.