Skip to content

Commit

Permalink
Add tests for method calls
Browse files Browse the repository at this point in the history
  • Loading branch information
amatveiakin committed Feb 11, 2025
1 parent 9af25c8 commit a877846
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/source/configs/float_literal_trailing_zero/always.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ fn range_bounds() {
let _binop_range = 3.0 / 2.0..4.0;
}

fn method_calls() {
let x = 1.0.neg();
let y = 2.3.neg();
let z = (4.).neg();
let u = 5.0f32.neg();
let v = -6.0.neg();
}

fn line_wrapping() {
let array = [
1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ fn range_bounds() {
let _binop_range = 3.0 / 2.0..4.0;
}

fn method_calls() {
let x = 1.0.neg();
let y = 2.3.neg();
let z = (4.).neg();
let u = 5.0f32.neg();
let v = -6.0.neg();
}

fn line_wrapping() {
let array = [
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11., 12., 13., 14., 15., 16., 17., 18.,
Expand Down
8 changes: 8 additions & 0 deletions tests/source/configs/float_literal_trailing_zero/never.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ fn range_bounds() {
let _binop_range = 3.0 / 2.0..4.0;
}

fn method_calls() {
let x = 1.0.neg();
let y = 2.3.neg();
let z = (4.).neg();
let u = 5.0f32.neg();
let v = -6.0.neg();
}

fn line_wrapping() {
let array = [
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0,
Expand Down
8 changes: 8 additions & 0 deletions tests/target/configs/float_literal_trailing_zero/always.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ fn range_bounds() {
let _binop_range = 3.0 / 2.0..4.0;
}

fn method_calls() {
let x = 1.0.neg();
let y = 2.3.neg();
let z = (4.0).neg();
let u = 5.0f32.neg();
let v = -6.0.neg();
}

fn line_wrapping() {
let array = [
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ fn range_bounds() {
let _binop_range = 3.0 / 2.0..4.0;
}

fn method_calls() {
let x = 1.0.neg();
let y = 2.3.neg();
let z = (4.0).neg();
let u = 5f32.neg();
let v = -6.0.neg();
}

fn line_wrapping() {
let array = [
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0,
Expand Down
8 changes: 8 additions & 0 deletions tests/target/configs/float_literal_trailing_zero/never.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ fn range_bounds() {
let _binop_range = 3. / 2. ..4.;
}

fn method_calls() {
let x = (1.).neg();
let y = 2.3.neg();
let z = (4.).neg();
let u = 5f32.neg();
let v = -(6.).neg();
}

fn line_wrapping() {
let array = [
1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18.,
Expand Down
8 changes: 8 additions & 0 deletions tests/target/configs/float_literal_trailing_zero/preserve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ fn range_bounds() {
if (1.0e1..2.0e1).contains(&1.0e1) {}
let _binop_range = 3.0 / 2.0..4.0;
}

fn method_calls() {
let x = 1.0.neg();
let y = 2.3.neg();
let z = (4.).neg();
let u = 5.0f32.neg();
let v = -6.0.neg();
}

0 comments on commit a877846

Please sign in to comment.