Skip to content

Commit a15b235

Browse files
0xrinegadeclaude
andcommitted
fix(ovsm): Suppress clippy::approx_constant warnings in test fixtures
Add #[allow(clippy::approx_constant)] to test functions that use hardcoded float values like 3.14, 3.14159, and SQRT_2 approximations. These are test fixtures validating LISP literal parsing and math functions, not constant definitions. The approximate values are intentional for testing purposes. ## Changes - lisp_comprehensive_tests.rs: Allow approx_constant in test_literals_floats and test_const_definition - lisp_e2e_tests.rs: Allow approx_constant in test_sqrt_float and test_abs_negative_float ## Results ✅ OVSM crate: 0 warnings ✅ OVSM tests: 391 passed ✅ Formatting: 100% compliant 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent feeed9a commit a15b235

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

crates/ovsm/tests/lisp_comprehensive_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ fn test_literals_integers() {
3434
}
3535

3636
#[test]
37+
#[allow(clippy::approx_constant)]
3738
fn test_literals_floats() {
3839
assert_eq!(execute_lisp("3.14").unwrap(), Value::Float(3.14));
3940
assert_eq!(execute_lisp("-2.5").unwrap(), Value::Float(-2.5));
@@ -265,6 +266,7 @@ fn test_set_incremental_mutation() {
265266
}
266267

267268
#[test]
269+
#[allow(clippy::approx_constant)]
268270
fn test_const_definition() {
269271
let source = r#"
270272
(const PI 3.14159)

crates/ovsm/tests/lisp_e2e_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,7 @@ fn test_sqrt_basic() {
937937
}
938938

939939
#[test]
940+
#[allow(clippy::approx_constant)]
940941
fn test_sqrt_float() {
941942
let source = "(sqrt 2.0)";
942943
let mut scanner = SExprScanner::new(source);
@@ -1029,6 +1030,7 @@ fn test_abs_negative_int() {
10291030
}
10301031

10311032
#[test]
1033+
#[allow(clippy::approx_constant)]
10321034
fn test_abs_negative_float() {
10331035
let source = "(abs -3.14)";
10341036
let mut scanner = SExprScanner::new(source);

0 commit comments

Comments
 (0)