unc_units/
lib.rs

1pub use unc_units_core::*;
2pub use unc_units_macro::*;
3
4#[cfg(test)]
5mod tests {
6    use super::*;
7    const ONE_UNC: u128 = 1_000_000_000_000_000_000_000_000;
8    const ONE_TGAS: u128 = 1_000_000_000_000;
9    const ONE_PARSED_UNC: u128 = parse_unc!("1 U");
10    const ONE_PARSED_TGAS: u128 = parse_gas!("1 TGas");
11
12    #[test]
13    fn const_parse_unc() {
14        assert_eq!(near::parse("1U").unwrap(), ONE_UNC);
15        assert_eq!(ONE_PARSED_UNC, ONE_UNC);
16    }
17
18    #[test]
19    fn const_parse_gas() {
20        assert_eq!(gas::parse("1 TGas").unwrap(), ONE_TGAS);
21        assert_eq!(ONE_PARSED_TGAS, ONE_TGAS);
22    }
23}