Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SizeAtLeast, SizeBetween and SizeAtMost for knownvalue #418

Open
zliang-akamai opened this issue Jan 23, 2025 · 0 comments
Open

SizeAtLeast, SizeBetween and SizeAtMost for knownvalue #418

zliang-akamai opened this issue Jan 23, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@zliang-akamai
Copy link

zliang-akamai commented Jan 23, 2025

An example:

{
	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),
		),
	},
}

It only has 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.

@zliang-akamai zliang-akamai added the enhancement New feature or request label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant