1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![doc(html_root_url = "https://docs.rs/bscore/1.2.1")]
//! bscore bowling score library for Rust
//!

pub mod bgame;

/// test with [-- --nocapture] or [-- --show-output]
#[cfg(test)]
mod tests {
  use super::*;
  use bgame::{bowling_score, bscore};

  /// test scores
  #[test]
  fn test_scores() {
    assert_eq!(bscore("G/G/G/G/G/G/G/G/G/G/G", false).unwrap(), [100]);
    assert_eq!(bscore("xxxxxxxxxxxx", false).unwrap(), [300]);
    assert_eq!(bscore("xxxxxxxxxxxxxx", true).unwrap(), [300, 300, 300]);
    assert_eq!(bowling_score(false, "etc/scores.txt").unwrap(), ());
    // assert_eq!(bowling_score(true, "etc/scores.txt").unwrap(), ());
    // assert_eq!(bowling_score(true, "").unwrap(), ());
  }
}