mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Move syntax tests to a dedicated crate
* test_fmt moves out of fmt crate * test_parse _mostly_ moves out of parse crate and into `test_snapshots.rs` (some simple tests remain) * now there's only two fuzz targets, fuzz_expr and fuzz_module, that cover both parsing and formatting * added a system to auto-add new snapshot entries for new test files * took some commented-out tests in `test_parse` and converted them to snapshot tests * moved test_fmt's verification of formatting consistency into test_snapshots * fixed a huge derp on my part where the fmt fuzzer in #4758 was completely useless (broken by refactoring just prior to submitting the PR) * fixed a formatting bug found by fuzzing (bound_variable.expr.roc) - that I missed earlier due to ^^^ that derp * no longer have roc_test_utils as a dependency in fmt - which was causing problems for the wasm build
This commit is contained in:
parent
f0b3c3eb08
commit
bfeddc470a
701 changed files with 1929 additions and 1516 deletions
14
crates/compiler/test_syntax/fuzz/fuzz_targets/fuzz_module.rs
Normal file
14
crates/compiler/test_syntax/fuzz/fuzz_targets/fuzz_module.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use bumpalo::Bump;
|
||||
use test_syntax::test_helpers::Input;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
if let Ok(input) = std::str::from_utf8(data) {
|
||||
let input = Input::Full(input);
|
||||
let arena = Bump::new();
|
||||
if input.parse_in(&arena).is_ok() {
|
||||
input.check_invariants(|_| (), true);
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue