Skip to content

Conversation

@kkweon
Copy link
Member

@kkweon kkweon commented Oct 2, 2025

Direct equality checks on floating-point numbers in tests can be unreliable due to precision issues, leading to flaky test failures.

This change replaces testify/assert.Equal with github.com/google/go-cmp for comparing structs that contain floating-point fields. By using cmpopts.EquateApprox, the tests now compare floats with a reasonable tolerance, making them more stable and reliable.

In addition, this commit includes several project maintenance updates:

  • Upgrades Go version to 1.23 in go.mod and CI.
  • Updates GitHub Actions to their latest versions for better performance and security.
  • Improves the .gitignore file to exclude the ModelGenerator/ and include/ directories.

kkweon added 2 commits October 2, 2025 00:51
Direct equality checks on floating-point numbers in tests can be unreliable due to precision issues, leading to flaky test failures.

This change replaces `testify/assert.Equal` with `github.com/google/go-cmp` for comparing structs that contain floating-point fields. By using `cmpopts.EquateApprox`, the tests now compare floats with a reasonable tolerance, making them more stable and reliable.

In addition, this commit includes several project maintenance updates:
- Upgrades Go version to 1.23 in `go.mod` and CI.
- Updates GitHub Actions to their latest versions for better performance and security.
- Improves the `.gitignore` file to exclude the `ModelGenerator/` and `include/` directories.
Several project files were missing a final newline character, which can cause issues with some tools and git diffs. This commit adds a newline to the end of the following files to ensure they are POSIX-compliant:
- .gitignore
- go.mod
- Makefile
- .github/workflows/ci.yaml
@kkweon kkweon force-pushed the fix-floating-point-comparisons branch from 55b0b80 to dc0cba1 Compare October 2, 2025 07:55
@kkweon kkweon requested a review from mrchypark October 2, 2025 07:56
@mrchypark mrchypark merged commit 207e68b into main Oct 2, 2025
2 checks passed
@mrchypark mrchypark deleted the fix-floating-point-comparisons branch October 2, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants