bun
bun copied to clipboard
Quick unit tests
The idea here is to have (some) unit tests use minimum dependencies so that it can be quickly compiled and run.
- packages added:
global
,logger
,js_ast
, with corresponding stubs for tests; - added
make quick-tests
command for a set of unit tests (seesrc/__quick_tests.zig
); - some not-so-quick tests are in
src/__all_quick_tests.zig
; - refactoring:
-
__global.zig
removed,Global
struct moved toglobal.zig
; -
UpdateRequest
moved out frominstall.zig
; - all allocators moved to
src/allocators/
,allocators.zig
renamed todata_structures.zig
(not directly related to tests, I just find it less confusing, can revert this though); - some global utility functions moved to
global_utils.zig
;
-
- bugs fixed:
-
SizeFormatter
will print0.51 KB
instead of1 KB
forfmt.size(513)
(special thanks to Zig anonymous struct literal); -
indexOfNotChar
will find a char (that's not equal to provided) as intended;
-
- added tests for:
-
SizeFormatter
-
range
-
copy
- scoped package test for
UpdateRequests.parse
-
- avoid using
brew --prefix <FORMULA>
on MacOS, it's very slow.