From 91a73d86d60841acce94803c1105a54e0c67d5b8 Mon Sep 17 00:00:00 2001 From: printfn Date: Fri, 15 Mar 2024 11:36:44 +0000 Subject: [PATCH] Add rack units (U) --- core/src/units/builtin.rs | 2 ++ core/tests/integration_tests.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/core/src/units/builtin.rs b/core/src/units/builtin.rs index dd07a84f..225c2658 100644 --- a/core/src/units/builtin.rs +++ b/core/src/units/builtin.rs @@ -588,6 +588,8 @@ const IMPERIAL_UNITS: &[UnitTuple] = &[ ("ramsdens_chain", "", "l@5 rope", ""), ("roman_mile", "roman_miles", "l@50 ramsdens_chain", ""), ("gunters_chain", "gunters_chains", "l@4 rod", ""), + ("rack_unit", "rack_units", "l@1.75 inches", ""), + ("U", "", "rack_unit", ""), ]; const LIQUID_UNITS: &[UnitTuple] = &[ diff --git a/core/tests/integration_tests.rs b/core/tests/integration_tests.rs index 018c8017..9da48c67 100644 --- a/core/tests/integration_tests.rs +++ b/core/tests/integration_tests.rs @@ -5940,3 +5940,8 @@ fn test_roman() { Some("100001 must lie in the interval [1, 100000]"), ); } + +#[test] +fn rack_unit() { + test_eval("4U to cm", "17.78 cm"); +}