Skip to content

Commit

Permalink
add tests for char_count
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrabear committed Nov 8, 2023
1 parent 3247ea8 commit a2b124c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/indexed_chars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ fn create() {
let s_buf = "foo";
let s = IndexedCharsInner::new(s_buf);

assert_eq!(s.char_count(&s_buf), 3);
assert!(s.rollovers.is_empty());
assert!(s.is_ascii());
assert_eq!(s.get_char(s_buf, 4), None);
Expand All @@ -125,6 +126,8 @@ fn create() {
);

assert_eq!(foo_s.get_char(&foo_alloc, 2), None);

assert_eq!(foo_s.char_count(&foo_alloc), 2);
}

#[test]
Expand Down

0 comments on commit a2b124c

Please sign in to comment.