Move crates under a sub folder to clean up the code

This commit is contained in:
Clément Renault 2024-10-21 08:18:43 +02:00
parent 30f3c30389
commit 9c1e54a2c8
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
1062 changed files with 19 additions and 20 deletions

3
crates/filter-parser/fuzz/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
/corpus/
/artifacts/
/target/

View file

@ -0,0 +1,25 @@
[package]
name = "filter-parser-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
[package.metadata]
cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4"
[dependencies.filter-parser]
path = ".."
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[[bin]]
name = "parse"
path = "fuzz_targets/parse.rs"
test = false
doc = false

View file

@ -0,0 +1 @@
channel = Ponce

View file

@ -0,0 +1 @@
channel != ponce

View file

@ -0,0 +1 @@
NOT channel = ponce

View file

@ -0,0 +1 @@
subscribers < 1000

View file

@ -0,0 +1 @@
subscribers > 1000

View file

@ -0,0 +1 @@
subscribers <= 1000

View file

@ -0,0 +1 @@
subscribers >= 1000

View file

@ -0,0 +1 @@
NOT subscribers < 1000

View file

@ -0,0 +1 @@
NOT subscribers > 1000

View file

@ -0,0 +1 @@
NOT subscribers <= 1000

View file

@ -0,0 +1 @@
NOT subscribers >= 1000

View file

@ -0,0 +1 @@
subscribers = 12

View file

@ -0,0 +1 @@
subscribers 100 TO 1000

View file

@ -0,0 +1 @@
NOT subscribers 100 TO 1000

View file

@ -0,0 +1 @@
_geoRadius(12, 13, 14)

View file

@ -0,0 +1 @@
NOT _geoRadius(12, 13, 14)

View file

@ -0,0 +1 @@
channel = ponce AND 'dog race' != 'bernese mountain'

View file

@ -0,0 +1 @@
channel = ponce OR 'dog race' != 'bernese mountain'

View file

@ -0,0 +1 @@
channel = ponce AND 'dog race' != 'bernese mountain' OR subscribers > 1000

View file

@ -0,0 +1 @@
channel = ponce AND ( 'dog race' != 'bernese mountain' OR subscribers > 1000 )

View file

@ -0,0 +1 @@
(channel = ponce AND 'dog race' != 'bernese mountain' OR subscribers > 1000) AND _geoRadius(12, 13, 14)

View file

@ -0,0 +1 @@
channel = Ponce = 12

View file

@ -0,0 +1 @@
channel = 'Mister Mv'

View file

@ -0,0 +1 @@
channel =

View file

@ -0,0 +1 @@
channel = 🐻

View file

@ -0,0 +1 @@
OR

View file

@ -0,0 +1 @@
AND

View file

@ -0,0 +1 @@
channel Ponce

View file

@ -0,0 +1 @@
channel = Ponce OR

View file

@ -0,0 +1 @@
_geoRadius

View file

@ -0,0 +1 @@
_geoRadius = 12

View file

@ -0,0 +1 @@
_geoPoint(12, 13, 14)

View file

@ -0,0 +1 @@
position <= _geoPoint(12, 13, 14)

View file

@ -0,0 +1 @@
channel = "Mister Mv"

View file

@ -0,0 +1 @@
position <= _geoRadius(12, 13, 14)

View file

@ -0,0 +1 @@
channel = 'ponce

View file

@ -0,0 +1 @@
channel = "ponce

View file

@ -0,0 +1 @@
channel = mv OR (followers >= 1000

View file

@ -0,0 +1 @@
'dog race' = Borzoi

View file

@ -0,0 +1 @@
"dog race" = Chusky

View file

@ -0,0 +1 @@
"dog race" = "Bernese Mountain"

View file

@ -0,0 +1 @@
'dog race' = 'Bernese Mountain'

View file

@ -0,0 +1 @@
"dog race" = 'Bernese Mountain'

View file

@ -0,0 +1,18 @@
#![no_main]
use filter_parser::{ErrorKind, FilterCondition};
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
// When we are fuzzing the parser we can get a stack overflow very easily.
// But since this doesn't happens with a normal build we are just going to limit the fuzzer to 500 characters.
if s.len() < 500 {
match FilterCondition::parse(s) {
Err(e) if matches!(e.kind(), ErrorKind::InternalError(_)) => {
panic!("Found an internal error: `{:?}`", e)
}
_ => (),
}
}
}
});