File: test_primitives.rs

package info (click to toggle)
rust-borsh 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,824 kB
  • sloc: makefile: 2
file content (33 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::common_macro::schema_imports::*;

#[test]
fn isize_schema() {
    let schema = schema_container_of::<isize>();

    assert_eq!(
        schema,
        BorshSchemaContainer::new(
            "i64".to_string(),
            schema_map! {
                "i64" => Definition::Primitive(8)

            }
        )
    )
}

#[test]
fn usize_schema() {
    let schema = schema_container_of::<usize>();

    assert_eq!(
        schema,
        BorshSchemaContainer::new(
            "u64".to_string(),
            schema_map! {
                "u64" => Definition::Primitive(8)

            }
        )
    )
}