Skip to content

Commit

Permalink
test(fisher test): test short circuit evaluation of all 0 row/columns
Browse files Browse the repository at this point in the history
  • Loading branch information
YeungOnion committed Jul 19, 2024
1 parent f57aab5 commit 5b123da
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/stats_tests/fisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,16 @@ mod tests {
}
}
}

#[test]
fn test_fishers_exact_for_trivial() {
let cases = [[0, 0, 1, 2], [1, 2, 0, 0], [1, 0, 2, 0], [0, 1, 0, 2]];

for table in cases.iter() {
assert_eq!(fishers_exact(table, Alternative::Less).unwrap(), 1.0)
}
}

#[test]
fn test_fishers_exact_with_odds() {
let table = [3, 5, 4, 50];
Expand Down

0 comments on commit 5b123da

Please sign in to comment.