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-testscommand for a set of unit tests (seesrc/__quick_tests.zig); - some not-so-quick tests are in
src/__all_quick_tests.zig; - refactoring:
__global.zigremoved,Globalstruct moved toglobal.zig;UpdateRequestmoved out frominstall.zig;- all allocators moved to
src/allocators/,allocators.zigrenamed 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:
SizeFormatterwill print0.51 KBinstead of1 KBforfmt.size(513)(special thanks to Zig anonymous struct literal);indexOfNotCharwill find a char (that's not equal to provided) as intended;
- added tests for:
SizeFormatterrangecopy- scoped package test for
UpdateRequests.parse
- avoid using
brew --prefix <FORMULA>on MacOS, it's very slow.