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 11, 2024
1 parent ef99f8a commit d028a9d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions casr/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4117,6 +4117,21 @@ fn test_casr_libfuzzer() {

assert_eq!(reports_cnt, 17, "Invalid number of reports in new 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 d028a9d

Please sign in to comment.