File: bool.rs

package info (click to toggle)
rust-rmp 0.8.14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 396 kB
  • sloc: makefile: 2
file content (21 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use super::Cursor;

use rmp::decode::*;

#[test]
fn from_bool_false() {
    let buf = [0xc2];
    let mut cur = Cursor::new(&buf[..]);

    assert!(!read_bool(&mut cur).unwrap());
    assert_eq!(1, cur.position());
}

#[test]
fn from_bool_true() {
    let buf = [0xc3];
    let mut cur = Cursor::new(&buf[..]);

    assert!(read_bool(&mut cur).unwrap());
    assert_eq!(1, cur.position());
}