-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e86a69b
commit 58997f7
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
target | ||
libfuzzer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
[package] | ||
name = "unicode-segmentation-fuzz" | ||
version = "0.0.1" | ||
authors = ["Automatically generated"] | ||
|
||
[dependencies.unicode-segmentation] | ||
path = ".." | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[[bin]] | ||
name = "graphemes" | ||
path = "fuzzers/graphemes.rs" | ||
|
||
[[bin]] | ||
name = "words" | ||
path = "fuzzers/words.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#![no_main] | ||
|
||
|
||
extern crate fuzzer_sys; | ||
|
||
|
||
extern crate unicode_segmentation; | ||
|
||
use unicode_segmentation::UnicodeSegmentation; | ||
use std::str; | ||
|
||
|
||
#[export_name="rust_fuzzer_test_input"] | ||
pub extern fn go(data: &[u8]) { | ||
if let Ok(s) = str::from_utf8(data) { | ||
let g = UnicodeSegmentation::graphemes(s, true).collect::<Vec<_>>(); | ||
assert!(UnicodeSegmentation::graphemes(s, true).rev().eq(g.iter().rev().cloned())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#![no_main] | ||
|
||
|
||
extern crate fuzzer_sys; | ||
|
||
|
||
extern crate unicode_segmentation; | ||
|
||
use unicode_segmentation::UnicodeSegmentation; | ||
use std::str; | ||
|
||
|
||
#[export_name="rust_fuzzer_test_input"] | ||
pub extern fn go(data: &[u8]) { | ||
if let Ok(s) = str::from_utf8(data) { | ||
let g = s.split_word_bounds().collect::<Vec<_>>(); | ||
assert!(s.split_word_bounds().rev().eq(g.iter().rev().cloned())); | ||
} | ||
} |