Files
pokerfreak/tests/exploit_style.rs
T
mmintel 04d5251acf Welt ohne fremden Namen: Pruefordner vollstaendig mitkopieren, Engine nur im eigenen Baum
Die Welt nannte 'pokerfreak' nur noch in zwei Harness-Zeilen - der Rest waren veraltete
Rust-Pruefungen im Pruefordner, die der Aufbau nie auffrischte.
2026-11-01 23:37:11 +01:00

72 lines
1.7 KiB
Rust

use rechner::exploit::profile::Profile;
use rechner::exploit::style::{classify, Style};
fn profile(vpip: Option<f64>, pfr: Option<f64>, fold_to_bet: Option<f64>) -> Profile {
Profile {
vpip,
pfr,
fold_to_bet,
aggression: None,
}
}
#[test]
fn nothing_known_is_unknown() {
assert_eq!(classify(&Profile::default()), Style::Unknown);
assert_eq!(
classify(&profile(Some(f64::NAN), None, Some(f64::NAN))),
Style::Unknown
);
}
#[test]
fn tight_players_are_nits() {
assert_eq!(classify(&profile(Some(0.10), Some(0.08), None)), Style::Nit);
assert_eq!(classify(&profile(None, None, Some(0.80))), Style::Nit);
}
#[test]
fn loose_and_raising_is_loose_aggressive() {
assert_eq!(
classify(&profile(Some(0.55), Some(0.35), None)),
Style::LooseAggressive
);
assert_eq!(
classify(&profile(Some(0.45), Some(0.30), Some(0.5))),
Style::LooseAggressive
);
}
#[test]
fn loose_and_passive_or_sticky_is_a_calling_station() {
assert_eq!(
classify(&profile(Some(0.50), Some(0.05), Some(0.2))),
Style::CallingStation
);
assert_eq!(
classify(&profile(Some(0.45), None, None)),
Style::CallingStation
);
assert_eq!(
classify(&profile(None, None, Some(0.15))),
Style::CallingStation
);
}
#[test]
fn ordinary_numbers_are_regular() {
assert_eq!(
classify(&profile(Some(0.22), Some(0.18), Some(0.5))),
Style::Regular
);
}
#[test]
fn out_of_range_values_are_clamped_not_trusted() {
assert_eq!(
classify(&profile(Some(7.0), Some(5.0), None)),
Style::LooseAggressive
);
assert_eq!(classify(&profile(Some(-3.0), None, None)), Style::Nit);
}