Skip to content

Commit

Permalink
Add sil score checking
Browse files Browse the repository at this point in the history
  • Loading branch information
hkctkuy committed Jun 10, 2024
1 parent ef99f8a commit 7669c8a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions casr/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4222,6 +4222,18 @@ fn test_casr_libfuzzer_atheris() {

assert_eq!(clusters_cnt, 2, "Invalid number of clusters");

let re = Regex::new(r"Cluster silhouette score: (?P<score>(0|1)\.\d+)").unwrap();
let sil_score = re
.captures(&err)
.unwrap()
.name("score")
.map(|x| x.as_str())
.unwrap()
.parse::<f64>()
.unwrap();

assert_eq!(sil_score, 0.3831644389715882, "Invalid cluster silhouette score");

let mut storage: HashMap<String, u32> = HashMap::new();
for entry in fs::read_dir(&paths[1]).unwrap() {
let e = entry.unwrap().path();
Expand Down

0 comments on commit 7669c8a

Please sign in to comment.