dims_core 0.5.1

Core Utils for Generating Units and Systems
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
mod common;
use common::*;

#[test]
fn test_debug() {
    // Floating Point Fun
    let val = INCH.from(30.0);
    let res = format!("{:?}", val);
    assert_eq!(&res, "29.999998 in");
    // Ensure different units still resolve correctly
    let val = SQFT.from(2.0);
    let res = format!("{:?}", val);
    assert_eq!(&res, "288 in²");
}