File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ target
3+ libfuzzer
Original file line number Diff line number Diff line change 1+
2+ [package ]
3+ name = " unicode-segmentation-fuzz"
4+ version = " 0.0.1"
5+ authors = [" Automatically generated" ]
6+
7+ [dependencies .unicode-segmentation ]
8+ path = " .."
9+
10+ # Prevent this from interfering with workspaces
11+ [workspace ]
12+ members = [" ." ]
13+
14+ [[bin ]]
15+ name = " graphemes"
16+ path = " fuzzers/graphemes.rs"
17+
18+ [[bin ]]
19+ name = " words"
20+ path = " fuzzers/words.rs"
Original file line number Diff line number Diff line change 1+ #![ no_main]
2+
3+
4+ extern crate fuzzer_sys;
5+
6+
7+ extern crate unicode_segmentation;
8+
9+ use unicode_segmentation:: UnicodeSegmentation ;
10+ use std:: str;
11+
12+
13+ #[ export_name="rust_fuzzer_test_input" ]
14+ pub extern fn go ( data : & [ u8 ] ) {
15+ if let Ok ( s) = str:: from_utf8 ( data) {
16+ let g = UnicodeSegmentation :: graphemes ( s, true ) . collect :: < Vec < _ > > ( ) ;
17+ assert ! ( UnicodeSegmentation :: graphemes( s, true ) . rev( ) . eq( g. iter( ) . rev( ) . cloned( ) ) ) ;
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ #![ no_main]
2+
3+
4+ extern crate fuzzer_sys;
5+
6+
7+ extern crate unicode_segmentation;
8+
9+ use unicode_segmentation:: UnicodeSegmentation ;
10+ use std:: str;
11+
12+
13+ #[ export_name="rust_fuzzer_test_input" ]
14+ pub extern fn go ( data : & [ u8 ] ) {
15+ if let Ok ( s) = str:: from_utf8 ( data) {
16+ let g = s. split_word_bounds ( ) . collect :: < Vec < _ > > ( ) ;
17+ assert ! ( s. split_word_bounds( ) . rev( ) . eq( g. iter( ) . rev( ) . cloned( ) ) ) ;
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments