rsvim_core 0.1.3-alpha.2

The core library for RSVIM text editor.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::cache::*;

#[test]
fn test1() {
  let mut stats = Stats::default();
  assert_eq!(stats.hits(), 0);
  assert_eq!(stats.misses(), 0);
  assert_eq!(stats.total(), 0);
  assert_eq!(stats.ratio(), 0_f32);
  stats.hit();
  stats.miss();
  assert_eq!(stats.hits(), 1);
  assert_eq!(stats.misses(), 1);
  assert_eq!(stats.total(), 2);
  assert_eq!(stats.ratio(), 0.5_f32);
}