This website requires JavaScript.
Explore
Help
Sign In
factotum
/
nats.zig
Watch
1
Fork
0
You've already forked nats.zig
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
nats.zig
/
tests
/
main.zig
6 lines
111 B
Zig
Raw
Normal View
History
Unescape
Escape
tests: start building tests in separate directory This approach seems nice, and as a bonus it makes it easier to run the tests through the module interface rather than by importing the sources directly, which I think is a good dog food approach.
2023-08-21 23:31:46 -07:00
test
{
tests: add top level function tests These are mostly just tests to make sure the wrappers function as written, rather than testing for any specific output. This commit demonstrates the simple value of actually referencing the various wrapper functions, as a variety of really basic compilation errors were caught and addressed.
2023-08-27 14:50:44 -07:00
_
=
@import
(
"
./nats.zig
"
)
;
tests: add basic connection test I created a utility class to spawn a NATS server. This assumes it is installed and in PATH, which should be easy enough to accomplish for a CI environment. The current approach will not work with parallel tests, but that's not a practical reality, so this route should be fine for the time being. It might be nice to spawn a default server at the beginning of testing and tear it down at the end, to save waiting for the startup/shutdown time in many individual tests. This makes me wonder: if I initialize a server in the beginning of the `test` block in main that imports the other modules, does that scope stay live while the "child" tests are running? My default guess would be probably not, but that would be very convenient, so I might try it out and see.
2023-08-27 18:10:53 -07:00
_
=
@import
(
"
./connection.zig
"
)
;
tests: start building tests in separate directory This approach seems nice, and as a bonus it makes it easier to run the tests through the module interface rather than by importing the sources directly, which I think is a good dog food approach.
2023-08-21 23:31:46 -07:00
_
=
@import
(
"
./message.zig
"
)
;
}
Reference in New Issue
Copy Permalink