GithubHelp home page GithubHelp logo

Comments (2)

rohlem avatar rohlem commented on September 15, 2024 2

test "teardownonce" {...}

It would be highly unintuitive for me if Zig changed the behavior of tests based on the string literal used to name the test case.
If such a feature were introduced, it should imo be specially marked in the source code in some other way.

I also don't think the benefit of the per-test setup and teardown is worth this special-casing.
You can already declare them as normal functions and start your test blocks with setup(); defer teardown(); for the same effect.

The proposal also isn't concrete enough about which scope these special constructs should apply to.
Currently zig test collects all test declarations found, starting with analysis of the root source file, and may include the entire source tree.
I doubt you need/want the same setup and teardown procedure for every test in your source code. This work is overhead for tests that don't need it.

Also note zig test CLI option --test-runner can already be used to specify a custom (modified) test runner.
You could use that to implement the setuponce and teardownonce behavior in userland in status-quo.

my second day in Zig ...

Feel free to discuss and share your experiences in one of the Community spaces.
This issue tracker tries to stay focused on technical discussion of bugs/deficiencies in Zig and core Zig toolchain development.
"X would be nice" feature requests are (in my experience) generally considered off-topic,
unless you can provide a use case that would directly benefit Zig toolchain development itself.

from zig.

g41797 avatar g41797 commented on September 15, 2024

Feel free to discuss and share your experiences in one of the Community spaces.

I added r/Zig to Community
Thanks you

from zig.

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.