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

Parse '-' in numeric values used in test case #1

Closed
luke-biel opened this issue Oct 17, 2017 · 1 comment
Closed

Parse '-' in numeric values used in test case #1

luke-biel opened this issue Oct 17, 2017 · 1 comment

Comments

@luke-biel
Copy link

For:

#[test_case(15, 15)]
#[test_case(-15, 15)]
fn test_abs(value: f64, expected: f64) {
   assert_eq!(value.abs(), expected)
}

We get error:

error[E0428]: the name `_15_15` is defined multiple times
  --> src/test.rs
   |
   |     #[test_case(15, 15)]
   |     ^^^^^^^^^^^^^^^^^^^^
   |     |
   |     previous definition of the value `_15_15` here
   |     `_15_15` redefined here
   |
   = note: `_15_15` must be defined only once in the value namespace of this module
@frondeus
Copy link

frondeus commented Oct 1, 2019

Hi, this crate is deprecated. I duplicated your issue in my crate.

Do you have an idea how to solve it?
Test case macro has to generate somehow ident from string and unfortunately right now - is removed.

I tought about replacing - with minus_ however '-' doesn't always mean minus. Sometimes it's just hyphen

@synek317 synek317 closed this as completed Oct 2, 2019
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

No branches or pull requests

3 participants