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

Add Int32 and Float32 type testing #258

Merged
merged 8 commits into from
Jul 10, 2024
Merged

Conversation

SBGoods
Copy link
Contributor

@SBGoods SBGoods commented Jul 1, 2024

Add test cases for int32 and float32 function types and float32 precision testing.

@SBGoods SBGoods requested a review from a team as a code owner July 1, 2024 20:58
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the tests here look good, left a couple notes about comments and version choices.

One more place to consider adding smoke tests for Float32Attribute and Int32Attribute is in the basic schema tests:

  • internal/framework5provider/schema_resource.go
  • internal/framework5provider/schema_resource_test.go
  • internal/framework6provider/schema_resource.go
  • internal/framework6provider/schema_resource_test.go

Great job! 🚀

})
}

func TestFloat32Function_overflow_underflow(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment on lines +79 to +82
// This test documents edge case behavior with math.MaxFloat32
// This number is unique in that it has an exact representation in both float32 and float64,
// it is also an integer, which may affect how this value gets encoded/decoded with go-cty.
// https://github.com/hashicorp/terraform-plugin-framework/issues/1017
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great explanation! ❤️

@SBGoods SBGoods merged commit c7c3613 into main Jul 10, 2024
81 checks passed
@SBGoods SBGoods deleted the SBGoods/int32-float32-testing branch July 10, 2024 17:53
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants