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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Angular Absement (base unit radian second, s).

quantity! {
    /// Angular Absement (base unit radian second, s).
    quantity: AngularAbsement; "angular absement";
    /// Dimension of angular absement, T (base unit radian second, s).
    dimension: ISQ<
        Z0,     // length
        Z0,     // mass
        P1,     // time
        Z0,     // electric current
        Z0,     // thermodynamic temperature
        Z0,     // amount of substance
        Z0>;    // luminous intensity
    kind: dyn (crate::si::marker::AngleKind);
    units {
        @radian_second: prefix!(none); "rad · s", "radian second", "radian seconds";
        @degree_second: 1.745_329_251_994_329_5_E-2; "° · s", "degree second", "degree seconds";
    }
}

#[cfg(test)]
mod tests {
    storage_types! {
        use crate::si::angular_absement as a;
        use crate::si::angle as l;
        use crate::si::quantities::*;
        use crate::si::time as t;
        use crate::tests::Test;
        use crate::num::One;

        #[test]
        fn check_dimension() {
            let _: AngularAbsement<V> = (Angle::new::<l::radian>(V::one())
                * Time::new::<t::second>(V::one())).into();
        }

        #[test]
        fn check_units() {
            test::<l::radian, t::second, a::radian_second>();
            test::<l::degree, t::second, a::degree_second>();

            fn test<L: l::Conversion<V>, T: t::Conversion<V>, A: a::Conversion<V>>() {
                Test::assert_eq(&AngularAbsement::new::<A>(V::one()),
                    &(Angle::new::<L>(V::one()) * Time::new::<T>(V::one())).into());
            }
        }
    }
}