Skip to content

fix(mofa-foundation): replace 3.14 with 1.5 in WorkflowValue float test#1286

Merged
LuigiGonnella merged 1 commit intomofa-org:mainfrom
rahulkr182:fix/1268-approx-constant-state-test
Mar 21, 2026
Merged

fix(mofa-foundation): replace 3.14 with 1.5 in WorkflowValue float test#1286
LuigiGonnella merged 1 commit intomofa-org:mainfrom
rahulkr182:fix/1268-approx-constant-state-test

Conversation

@rahulkr182
Copy link
Copy Markdown

Summary

Fixes #1268

The literal 3.14f64 in test_workflow_value_conversions approximates π and triggers the deny-level clippy::approx_constant lint, causing both cargo test -p mofa-foundation and cargo clippy --all-targets to fail with a hard compiler error.

Changes

Replace 3.14f64 / 3.14 with 1.5f64 / 1.5 — a clean, non-special float that exercises the same WorkflowValue::Float round-trip behaviour without triggering the lint.

- let v: WorkflowValue = 3.14f64.into();
- assert_eq!(v.as_f64(), Some(3.14));
+ let v: WorkflowValue = 1.5f64.into();
+ assert_eq!(v.as_f64(), Some(1.5));

Verification

cargo clippy -p mofa-foundation --tests   # exit 0, no approx_constant errors
cargo test -p mofa-foundation             # all tests pass

The literal 3.14f64 approximates π and triggers the deny-level
clippy::approx_constant lint, causing cargo test -p mofa-foundation
and cargo clippy --all-targets to fail with a hard error.

Replace with 1.5f64 which is a clean, non-special float that exercises
the same WorkflowValue::Float round-trip behaviour.

Fixes mofa-org#1268
@LuigiGonnella LuigiGonnella merged commit b2358bc into mofa-org:main Mar 21, 2026
6 checks passed
@rahulkr182 rahulkr182 deleted the fix/1268-approx-constant-state-test branch March 21, 2026 18:07
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.

[Bug] mofa-foundation tests won't compile: denied approx_constant clippy lint on 3.14 literal in workflow/state.rs

2 participants