Git Product home page Git Product logo

Comments (4)

frondeus avatar frondeus commented on August 24, 2024

That's an exciting idea. However, the intention was to provide a human-readable test description, not necessarily a compiler-readable one. For example:

    #[test_case(4,  2  ; "when operands are swapped")]
    #[test_case(-2, -4 ; "when both operands are negative")]
    #[test_case(2,  4  ; "when both operands are positive")]

As you can see, in this example, we have to sanitize input.

Anyway, you have a valid point. @luke-biel - perhaps we should introduce some kind of feature flag or syntax (like different quotes used) to enable "strict mode"?

from test-case.

GabrielSimonetto avatar GabrielSimonetto commented on August 24, 2024

the intention was to provide a human-readable test description, not necessarily a compiler-readable one.

Hmm, yes, that makes sense

from test-case.

luke-biel avatar luke-biel commented on August 24, 2024

perhaps we should introduce some kind of feature flag or syntax (like different quotes used) to enable "strict mode"?
@frondeus I'd see extra arg to test case rather than changing syntax of the description.

#[test_case(4, 2 ; "when operands are swapped", fn_name = my_very_custom_name)]

I'm just not sure if this doesn't introduce bloat within test-case - how many people are gonna use it?

from test-case.

AugustoFKL avatar AugustoFKL commented on August 24, 2024

IMHO, a project using test_case should almost always add a name to the test, for good practices. But I think refining the opposite is still something good.

The solution provided on #19 would solve this problem, but the question is: what defined a "bad test name"? Anything besides alphanumeric, spaces, and underscores?

from test-case.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.