Browse Source

add test cases for complex conversions

Daniel Sheffield 2 years ago
parent
commit
137b694bdf
1 changed files with 9 additions and 2 deletions
  1. 9 2
      units.sql

+ 9 - 2
units.sql

@@ -68,8 +68,15 @@ BEGIN
       ('Gallon (US)', 'fl. oz. (US)', '', 128),
       ('Gallon (US)', 'fl. oz. (US)', '', 128),
       ('Gallon (US)', 'Pint (US)', '', 8),
       ('Gallon (US)', 'Pint (US)', '', 8),
       ('Gallon (US)', 'Quart (US)', '', 4), -- *
       ('Gallon (US)', 'Quart (US)', '', 4), -- *
-      ('Gallon (US)', 'mL', '', 4*32*236.5882365/8)
-      
+      ('Gallon (US)', 'mL', '', 4*32*236.5882365/8),
+      ('Cup (metric)', 'kg', 'Whole Oats', 0.214/2), -- *
+      ('Cup (metric)', 'kg', 'Puffed Rice', .03), -- *
+      ('Cup (metric)', 'kg', 'Coconut Desiccated', .071*2), -- *
+      -- ('Cup (metric)', 'kg', 'Peanut butter', .24),
+      ('Cup (metric)', 'kg', 'Honey', .68), -- *
+      ('kg', 'mL', 'Honey', 250/.68),
+      ('Cup (metric)', 'kg', 'Brown Sugar', .055*4), -- *
+      ('g', 'mL', 'Brown Sugar', 250/.055/4/1000)
     ) AS tests(f,t,p,e) LOOP
     ) AS tests(f,t,p,e) LOOP
     BEGIN
     BEGIN
       SELECT convert_unit(item.f, item.t, item.p) INTO result;
       SELECT convert_unit(item.f, item.t, item.p) INTO result;