-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.js
executable file
·298 lines (293 loc) · 23.1 KB
/
test.js
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#! /usr/bin/node
"use strict";
var mc = require('./metric-cooking');
var tests = [
['1 cup Guinness', '1 cup [240 ml] Guinness'],
['3/4 cup unsweetened cocoa', '3/4 cup unsweetened cocoa [65 g]'],
['1 1/4 cups confectioners’ sugar', '1 1/4 cups confectioners’ sugar [150 g]'],
['1 tb vanilla extract', '1 tb [15 ml] vanilla extract'],
['chopped into 1-inch chunks', 'chopped into 1-inch [2.5 cm] chunks'],
['2 1/2 tsp baking soda', '2 1/2 tsp baking soda [11 g]'],
['8 oz cream cheese', '8 oz cream cheese [225 g]'],
['1 stick, plus 1 tb, unsalted butter', '1 stick [110 g], plus 1 tb [15 ml], unsalted butter'],
['8 ounces spaghetti (or other) pasta', '8 ounces [225 g] spaghetti (or other) pasta'],
['2 Tbsp olive oil', '2 Tbsp [30 ml] olive oil'],
['at least 4 quarts of water', 'at least 4 quarts [3.75 l] of water'],
['2 cups flour', '2 cups flour [250 g]'],
['2 cups dark brown sugar', '2 cups dark brown sugar [450 g]'],
['1/4 cup pine nuts', '1/4 cup pine nuts [34 g]'],
['1 lb semi-sweet chocolate chips', '1 lb semi-sweet chocolate chips [450 g]'],
// false positives with C meaning °C
// ['1/2 C butter', '1/2 C butter [55 g]'],
['1 t vanilla, almond, coconut, or orange extract', '1 t [5 ml] vanilla, almond, coconut, or orange extract'],
['about 6 T unpopped', 'about 6 T [90 ml] unpopped'],
['2 T cocoa powder', '2 T cocoa powder [11 g]'],
['2/3 cup smooth peanut butter', '2/3 cup smooth peanut butter [175 g]'],
['3 tablespoons unsalted butter, melted', '3 tablespoons unsalted butter [43 g], melted'],
['1 teaspoon unflavored gelatin', '1 teaspoon [5 ml] unflavored gelatin'],
['from a 1/4-ounce envelope', 'from a 1/4-ounce [7 g] envelope'],
['3/8 tablespoon salt', '3/8 tablespoon salt [7 g]'],
['1 cup dulce de leche', '1 cup dulce de leche [300 g]'],
['2 teaspoons light corn syrup', '2 teaspoons light corn syrup [14 g]'],
['preheat oven to 325°F.', 'preheat oven to 325°F [165 °C].'],
['1 tsp bicarbonate of soda', '1 tsp bicarbonate of soda [5 g]'],
['2 tsp baking powder', '2 tsp baking powder [9 g]'],
['½ tbsp salt', '½ tbsp salt [9 g]'],
['1 tbsp vanilla extract', '1 tbsp [15 ml] vanilla extract'],
['4 tbsp. Dijon mustard', '4 tbsp. Dijon mustard [62 g]'],
['3/4 pound pasta', '3/4 pound [350 g] pasta'],
['Preheat oven to 350 degrees F with rack in middle.', 'Preheat oven to 350 degrees F [175 °C] with rack in middle.'],
['2 cups all-purpose flour', '2 cups all-purpose flour [250 g]'],
['1 3/4 cups sugar', '1 3/4 cups sugar [350 g]'],
['2 cups sifted cake flour', '2 cups sifted cake flour [225 g]'],
['10 Tbs unsalted butter, at room temperature' ,'10 Tbs unsalted butter [140 g], at room temperature'],
['if using unsalted, add 1/2 tbsp of salt', 'if using unsalted, add 1/2 tbsp of salt [9 g]'],
['1/2 cup packed light brown sugar', '1/2 cup packed light brown sugar [110 g]'],
['1/2 cup packed dark brown sugar', '1/2 cup packed dark brown sugar [110 g]'],
['2 cups confectioners sugar, must be sifted!', '2 cups confectioners sugar [240 g], must be sifted!'],
['Preheat the oven to 350 degrees Fahrenheit.', 'Preheat the oven to 350 degrees Fahrenheit [175 °C].'],
['2 cups all purpose flour', '2 cups all purpose flour [250 g]'],
['1/4 teaspoon black pepper', '1/4 teaspoon black pepper'],
['2 tablespoons finely grated parmesan', '2 tablespoons finely grated parmesan [13 g]'],
['1 1/2sticks chilled unsalted butter', '1 1/2sticks chilled unsalted butter [175 g]'],
['spacing 2 inches apart', 'spacing 2 inches [5 cm] apart'],
['4 tablespoons salted butter', '4 tablespoons salted butter [57 g]'],
['1 1/3 cups ricotta', '1 1/3 cups ricotta [325 g]'],
['2 tablespoons of the butter', '2 tablespoons of the butter [28 g]'],
['1/4 cup shredded Parmesan cheese', '1/4 cup shredded Parmesan cheese [25 g]'],
['1/2 pound fresh ricotta', '1/2 pound fresh ricotta [225 g]'],
['64 ounces chicken broth', '64 ounces [1.8 kg] chicken broth'],
['2 cups low-fat cottage cheese', '2 cups low-fat cottage cheese [450 g]'],
['8 3/4 oz. sugar', '8 3/4 oz. sugar [250 g]'],
['2 tablespoons cold butter', '2 tablespoons cold butter [28 g]'],
['Heat oil in a 5- to 6-quart heavy pot', 'Heat oil in a 5- to 6-quart [4.75–5.75 l] heavy pot'],
['1 3/4 cups (packed) brown sugar', '1 3/4 cups (packed) brown sugar [375 g]'],
['1 cup plain yogurt', '1 cup plain yogurt [250 g]'],
['1 1/2 cups Arborio rice', '1 1/2 cups Arborio rice [300 g]'],
['1 cup freshly grated Parmesan', '1 cup freshly grated Parmesan [100 g]'],
['2 or 3 cups broccoli florets', '2 or 3 cups [475–700 ml] broccoli florets'],
['add 3-4 tablespoons flour', 'add 3-4 tablespoons flour [23–31 g]'],
['1-2 Tbs white distilled vinegar', '1-2 Tbs [15–30 ml] white distilled vinegar'],
['1 chicken (2 1/2 to 3 pounds), cut into 8 pieces', '1 chicken (2 1/2 to 3 pounds [1.1–1.4 kg]), cut into 8 pieces'],
['with sides about 2 1/2 to 3 inches high', 'with sides about 2 1/2 to 3 inches [6.5–7.5 cm] high'],
['in a 10- to 12-inch ovenproof heavy skillet', 'in a 10- to 12-inch [25–30 cm] ovenproof heavy skillet'],
['Makes about twelve 3- to 4-inch pancakes', 'Makes about twelve 3- to 4-inch [7.5–10 cm] pancakes'],
['boil in a 1- to 1 1/2-quart heavy saucepan', 'boil in a 1- to 1 1/2-quart [950–1400 ml] heavy saucepan'],
['1 (14- to 19-ounce) can chickpeas', '1 (14- to 19-ounce [400–550 g]) can chickpeas'],
['torn into 1/4- to 1/2-inch pieces', 'torn into 1/4- to 1/2-inch [6–13 mm] pieces'],
['scrubbed and cut into 1/2-inch to 3/4-inch cubes', 'scrubbed and cut into 1/2-inch to 3/4-inch [1.3–1.9 cm] cubes'],
['1/4 cup corn syrup', '1/4 cup corn syrup [85 g]'],
['1 pint cherry tomatoes', '1 pint cherry tomatoes [350 g]'],
['Preheat oven to 450° F.', 'Preheat oven to 450° F [230 °C].'],
['1 cup mayonnaise', '1 cup mayonnaise [225 g]'],
['1/2 cup low-fat yogurt (preferably Greek)', '1/2 cup low-fat yogurt [125 g] (preferably Greek)'],
['6 Tablespoons rice vinegar', '6 Tablespoons [90 ml] rice vinegar'],
['1/4 cup parmigiano reggiano (grated)', '1/4 cup parmigiano reggiano [25 g] (grated)'],
['1 cup asparagus (cleaned)', '1 cup asparagus [130 g] (cleaned)'],
['1/4 cup spinach (optional)', '1/4 cup spinach [8 g] (optional)'],
['2 tablespoons pistachios (toasted)', '2 tablespoons pistachios [15 g] (toasted)'],
['2 TBL unsweetened cocoa powder', '2 TBL unsweetened cocoa powder [11 g]'],
['1 TSP lemon juice', '1 TSP [5 ml] lemon juice'],
['1/3 cup cornstarch', '1/3 cup cornstarch [43 g]'],
['½ cup orange marmalade', '½ cup orange marmalade [160 g]'],
['1 lb. lentils – regular or De Puy variety', '1 lb. lentils [450 g] – regular or De Puy variety'],
['3 cups canned chickpeas, divided', '3 cups canned chickpeas [450 g], divided'],
['2 tablespoons tomato paste', '2 tablespoons tomato paste [33 g]'],
['3 cups short-grain brown rice', '3 cups short-grain brown rice [600 g]'],
['make certain your freezer is set to 0°F.', 'make certain your freezer is set to 0°F [-18 °C].'],
['3/4 cup granulated sugar', '3/4 cup granulated sugar [150 g]'],
['2 Tbs. Dutch-processed cocoa powder', '2 Tbs. Dutch-processed cocoa powder [11 g]'],
['1 cup basmati rice', '1 cup basmati rice [190 g]'],
['1 1/2 cups unbleached all-purpose flour', '1 1/2 cups unbleached all-purpose flour [190 g]'],
['3/4 cup plus 2 tablespoons packed light-brown sugar', '3/4 cup plus 2 tablespoons packed light-brown sugar [190 g]'],
['1 cup blackberries', '1 cup blackberries [140 g]'],
['Dump in 1/2 cup crumbled blue cheese', 'Dump in 1/2 cup crumbled blue cheese [68 g]'],
['3/4 cup unsweetened Dutch process cocoa powder', '3/4 cup unsweetened Dutch process cocoa powder [65 g]'],
['1/4 cup firmly packed light brown sugar', '1/4 cup firmly packed light brown sugar [55 g]'],
['1/2 cup sun-dried tomatoes', '1/2 cup sun-dried tomatoes [27 g]'],
['2 cups long grain rice', '2 cups long grain rice [375 g]'],
['3/4 cup pecans, toasted', '3/4 cup pecans [75 g], toasted'],
['1/3 cup shredded mozzarella cheese', '1/3 cup shredded mozzarella cheese [37 g]'],
['1/4 cup of honey', '1/4 cup of honey [85 g]'],
['1/2 cup raisins', '1/2 cup raisins [83 g]'],
['2 teaspoons kosher salt or 1 teaspoon table salt', '2 teaspoons kosher salt [6 g] or 1 teaspoon table salt [6 g]'],
['1 cup long-grain white rice', '1 cup long-grain white rice [190 g]'],
['Add 1/3 cup finely chopped shallots to the saucepan.', 'Add 1/3 cup finely chopped shallots [53 g] to the saucepan.'],
['1/4 cup minced fresh Italian parsley', '1/4 cup minced fresh Italian parsley [15 g]'],
['1 1/4 cups aged white cheddar', '1 1/4 cups aged white cheddar [140 g]'],
['2/3 cup freshly grated Parmigiano-Reggiano', '2/3 cup freshly grated Parmigiano-Reggiano [65 g]'],
['2 tablespoons minced fresh flat-leaf parsley leaves', '2 tablespoons minced fresh flat-leaf parsley leaves [8 g]'],
['1 Tablespoon cream cheese, at room temperature', '1 Tablespoon cream cheese [15 g], at room temperature'],
['3/4 cup grated Swiss cheese', '3/4 cup grated Swiss cheese [80 g]'],
['2 cups ricotta cheese', '2 cups ricotta cheese [500 g]'],
['1-1/2 to 2 cups freshly grated Romano cheese', '1-1/2 to 2 cups freshly grated Romano cheese [150–200 g]'],
['Begin the assembly by preheating the oven to 375ºF', 'Begin the assembly by preheating the oven to 375ºF [190 °C]'],
['1 1/2 cups icing sugar', '1 1/2 cups icing sugar [175 g]'],
['1 cup brown rice', '1 cup brown rice [190 g]'],
['- 3 Tbsp pinenuts', '- 3 Tbsp pinenuts [25 g]'],
['combine 2 tablespoons softened butter', 'combine 2 tablespoons softened butter [28 g]'],
['2/3 cup feta cheese', '2/3 cup feta cheese [100 g]'],
['1 3- to 4-ounce wedge blue cheese', '1 3- to 4-ounce [85–110 g] wedge blue cheese'],
['¾ cup wild rice', '¾ cup wild rice [120 g]'],
['1 cup onions, chopped', '1 cup onions, chopped [160 g]'],
['1.5 cups arborio rice', '1.5 cups arborio rice [300 g]'],
['1/2 – 1 lb linguine', '1/2 – 1 lb [225–450 g] linguine'],
['½ stick cinnamon', '½ stick cinnamon'],
['1 1/4 cups jasmine rice', '1 1/4 cups jasmine rice [225 g]'],
['1 cup lentils', '1 cup lentils [190 g]'],
['1 cup (packed) golden brown sugar', '1 cup (packed) golden brown sugar [225 g]'],
['1½ pounds sweet potatoes (1lb 11oz)', '1½ pounds [700 g] sweet potatoes (1lb 11oz [750 g])'],
['¼ cup pure maple syrup','¼ cup pure maple syrup [80 g]'],
['1 1/2 cups raw almonds', '1 1/2 cups raw almonds [220 g]'],
['1/2 cup of low-fat feta cheese', '1/2 cup of low-fat feta cheese [75 g]'],
['1/4 cup natural peanut butter', '1/4 cup natural peanut butter [65 g]'],
['1 1/2 cups to 2 cups fresh or frozen cranberries','1 1/2 cups to 2 cups fresh or frozen cranberries [150–200 g]'],
['1/2 cup white sugar', '1/2 cup white sugar [100 g]'],
['1/2 cup pecan halves', '1/2 cup pecan halves [50 g]'],
['6 tablespoons or 3 ounces cold unsalted butter', '6 tablespoons [90 ml] or 3 ounces cold unsalted butter [85 g]'],
['½ cup creamy peanut butter', '½ cup creamy peanut butter [130 g]'],
['3 tablespoons shredded part-skim mozzarella cheese', '3 tablespoons shredded part-skim mozzarella cheese [21 g]'],
['1 cup (2 sticks or 8 ounces) butter', '1 cup [240 ml] (2 sticks or 8 ounces [225 g]) butter'],
['3 cups unbleached pastry flour', '3 cups unbleached pastry flour [350 g]'],
['About one cup', 'About one cup [240 ml]'],
['Heat the olive oil in a four-quart pot', 'Heat the olive oil in a four-quart [3.75 l] pot'],
['Caramelize a nine-inch round or tube pan', 'Caramelize a nine-inch [22.5 cm] round or tube pan'],
['add a tablespoon of heavy cream and stir', 'add a tablespoon of heavy cream [15 g] and stir'],
['a little less than a cup', 'a little less than a cup [240 ml]'],
['Divide the mixture among ten 3-ounce pop molds', 'Divide the mixture among ten 3-ounce [85 g] pop molds'],
['I used about 1/4 to 1/3 of a cup and', 'I used about 1/4 to 1/3 of a cup [60–80 ml] and'],
['at about 350-380 degrees (F).', 'at about 350-380 degrees (F) [175–195 °C].'],
['1 cup of peanuts (or any kind of nuts)', '1 cup of peanuts [145 g] (or any kind of nuts)'],
['¾ cup plus 2 Tbs sugar', '¾ cup plus 2 Tbs sugar [175 g]'],
['1/3 cup plus 2 tablespoons packed dark brown sugar', '1/3 cup plus 2 tablespoons packed dark brown sugar [100 g]'],
['1 cup + 1 tablespoon all purpose flour', '1 cup + 1 tablespoon all purpose flour [130 g]'],
['1 lb 2 oz penne rigate', '1 lb 2 oz [500 g] penne rigate'],
['1 cup of rice needs 1 and 1/4 cups of water', '1 cup of rice [190 g] needs 1 and 1/4 cups [300 ml] of water'],
['1 and 1/2 cups of milk, you know, roughly', '1 and 1/2 cups [350 ml] of milk, you know, roughly'],
['for half a pound for the 2 of us', 'for half a pound [225 g] for the 2 of us'],
['1 tablespoon plus 1 ½ teaspoons baking powder', '1 tablespoon plus 1 ½ teaspoons baking powder [21 g]'],
['Eight 8-inch flour tortillas', 'Eight 8-inch flour [20 cm] tortillas'],
['or a quarter of an ounce, which will cost about $40', 'or a quarter of an ounce [7 g], which will cost about $40'],
['1/2 cup sliced almonds, toasted', '1/2 cup sliced almonds [45 g], toasted'],
['Add a 1/2 cup of cinnamon', 'Add a 1/2 cup [120 ml] of cinnamon'],
['Divide the mixture among ten 3-ounce pop molds', 'Divide the mixture among ten 3-ounce [85 g] pop molds'],
['A few tablespoons of Torani flavoring syrups', 'A few tablespoons of Torani flavoring syrups'],
['1 2.5 lb boneless eye-round roast, tied', '1 2.5 lb [1.1 kg] boneless eye-round roast, tied'],
['One 1/8-inch thick slice presunto', 'One 1/8-inch [3 mm] thick slice presunto'],
['makes 1 9-inch pie crust', 'makes 1 9-inch [22.5 cm] pie crust'],
['1 28-ounce can San Marzano tomatoes', '1 28-ounce [800 g] can San Marzano tomatoes'],
['to fit mine in a 9×13-inch baking pan', 'to fit mine in a 9×13-inch [22.5×32.5 cm] baking pan'],
['roll out the dough into a 20-by-12-inch rectangle', 'roll out the dough into a 20-by-12-inch [50×30 cm] rectangle'],
['Butter a 13- by 9- by 2-inch baking pan', 'Butter a 13- by 9- by 2-inch [32.5×22.5×5 cm] baking pan'],
['Gently knead dough into a 10-by-8-inch rectangle', 'Gently knead dough into a 10-by-8-inch [25×20 cm] rectangle'],
['Butter two 9×2 inch round cake pans', 'Butter two 9×2 inch [22.5×5 cm] round cake pans'],
['Butter a 9x5 inch loaf pan', 'Butter a 9x5 inch [22.5×12.5 cm] loaf pan'],
['ramekins or a 9”-by-13” baking dish', 'ramekins or a 9”-by-13” [22.5×32.5 cm] baking dish'],
['Line a 13" x 18" x 1" baking sheet', 'Line a 13" x 18" x 1" [32.5×45×2.5 cm] baking sheet'],
['Grease a 9-x-5-x-3-inch loaf pan', 'Grease a 9-x-5-x-3-inch [22.5×12.5×7.5 cm] loaf pan'],
['in a parchment-lined 15x10x1-inch pan', 'in a parchment-lined 15x10x1-inch [37.5×25×2.5 cm] pan'],
['Lightly butter a 9-by-5-by-3-inch loaf pan', 'Lightly butter a 9-by-5-by-3-inch [22.5×12.5×7.5 cm] loaf pan'],
['5 strips, each about 12 by 4 inches', '5 strips, each about 12 by 4 inches [30×10 cm]'],
['mixture evenly in a 9x13" baking dish', 'mixture evenly in a 9x13" [22.5×32.5 cm] baking dish'],
['mandoline set to 1/16th of an inch.', 'mandoline set to 1/16th of an inch [2 mm].'],
['Five tablespoons of flour', 'Five tablespoons of flour [40 g]'],
['1 1⁄2 cups finely grated Parmesan', '1 1⁄2 cups finely grated Parmesan [150 g]'],
['½ cup dark chocolate chips', '½ cup dark chocolate chips [85 g]'],
['about 1 pound 2-inch florets', 'about 1 pound [450 g] 2-inch [5 cm] florets'],
['between 1/8 and 1/4-inch', 'between 1/8 and 1/4-inch [3–6 mm]'],
['between 12 ounces and a pound—that\'s big', 'between 12 ounces and a pound [350–450 g]—that\'s big'],
['1-¼ cup sugar, Divided', '1-¼ cup sugar [250 g], Divided'],
['1/4 cup superfine sugar', '1/4 cup superfine sugar [48 g]'],
['1 cup creme fraiche', '1 cup creme fraiche [225 g]'],
['1 cup Mexican crema (or creme fraiche)', '1 cup Mexican crema [225 g] (or creme fraiche)'],
['Pre-heat your oven to 350*F.', 'Pre-heat your oven to 350*F [175 °C].'],
['⅓ cup cocoa nibs', '⅓ cup cocoa nibs [45 g]'],
['5 tbsp golden caster sugar', '5 tbsp golden caster sugar [60 g]'],
['1/2 cup peeled almonds', '1/2 cup peeled almonds [70 g]'],
['1 3/4 cups uncooked brown rice', '1 3/4 cups uncooked brown rice [325 g]'],
['1 cup brown or green lentils, washed and picked over', '1 cup brown or green lentils [190 g], washed and picked over'],
['3/4 cup sliced and toasted almonds', '3/4 cup sliced and toasted almonds [70 g]'],
['1 cup vanilla yogurt (full fat)', '1 cup vanilla yogurt [250 g] (full fat)'],
['4-5 TBSP lemon juice', '4-5 TBSP [60–75 ml] lemon juice'],
['1/4 cup yellow cornmeal', '1/4 cup yellow cornmeal [40 g]'],
['1 cup cherry tomatoes, sliced in half', '1 cup cherry tomatoes [150 g], sliced in half'],
['1 cup farro', '1 cup farro [190 g]'],
['2 cups arugula leaves', '2 cups arugula leaves [40 g]'],
['1 cup mint leaves', '1 cup mint leaves [25 g]'],
['3/4 cup halved cherry or grape tomatoes', '3/4 cup halved cherry or grape tomatoes [110 g]'],
['1 cup pearled (Israeli) cous cous', '1 cup pearled (Israeli) cous cous [150 g]'],
['1 1/2 cup Israeli or pearl couscous', '1 1/2 cup Israeli or pearl couscous [225 g]'],
['1 1/2 cups orzo', '1 1/2 cups orzo [340 g]'],
['1 cup Nutella', '1 cup Nutella [280 g]'],
['1 cup pitted dried cherries', '1 cup pitted dried cherries [160 g]'],
['1 cup sour cream, at room temperature', '1 cup sour cream [225 g], at room temperature'],
['2 1/2 cups heavy or whipping cream, chilled', '2 1/2 cups heavy or whipping cream [600 g], chilled'],
['1 cup whole wheat pastry flour', '1 cup whole wheat pastry flour [120 g]'],
['1 cup dried apricots', '1 cup dried apricots [130 g]'],
['1 cup Bomba or Calasparra rice', '1 cup Bomba or Calasparra rice [200 g]'],
['1 ½ cups full-fat plain yogurt', '1 ½ cups full-fat plain yogurt [375 g]'],
['1/4 cup toasted pecans', '1/4 cup toasted pecans [25 g]'],
['1/4 cup grated Pecorino Romano cheese', '1/4 cup grated Pecorino Romano cheese [25 g]'],
['3/4 cup unsweetened shredded coconut', '3/4 cup unsweetened shredded coconut [70 g]'],
['1 cup walnuts', '1 cup walnuts [100 g]'],
['1 cup shelled pistachios, roasted and salted', '1 cup shelled pistachios [125 g], roasted and salted'],
['1 1/2 cups dry couscous', '1 1/2 cups dry couscous [260 g]'],
['1 cup warm, cooked brown rice, lightly salted', '1 cup warm, cooked brown rice [190 g], lightly salted'],
['2 cups self raising flour', '2 cups self raising flour [250 g]'],
['either 1 1/2 cups quark, or', 'either 1 1/2 cups quark [375 g], or'],
['2 teaspoons mustard seed', '2 teaspoons [10 ml] mustard seed'],
['1/2 cup roasted salted peanuts, roughly chopped', '1/2 cup roasted salted peanuts [73 g], roughly chopped'],
['about 1 1/2 cups of whole milk yogurt in the end', 'about 1 1/2 cups of whole milk yogurt [375 g] in the end'],
['2 tablespoons sesame seeds', '2 tablespoons sesame seeds [18 g]'],
['2 tablespoons toasted sesame oil', '2 tablespoons [30 ml] toasted sesame oil'],
['1/3 cup of cold, unsalted butter', '1/3 cup of cold, unsalted butter [75 g]'],
['1 cup steel cut oats', '1 cup steel cut oats [160 g]'],
['2 tablespoons matzo meal', '2 tablespoons matzo meal [15 g]'],
['¼ cup sun dried tomatoes, chopped', '¼ cup sun dried tomatoes [14 g], chopped'],
['2 cups cold cooked rice, preferably jasmine', '2 cups cold cooked rice [375 g], preferably jasmine'],
['3/4 cup plus 2 tablespoons', '3/4 cup plus 2 tablespoons [210 ml]'],
['1 cup full fat greek yogurt', '1 cup full fat greek yogurt [250 g]'],
['1/3 cup mild honey, to taste', '1/3 cup mild honey [110 g], to taste'],
['1/2 cup tahini roasted garlic dressing', '1/2 cup tahini [120 g] roasted garlic dressing'],
['2 Tbsp whole grain Dijon mustard', '2 Tbsp whole grain Dijon mustard [31 g]'],
['1/2 cup, plus 1 tablespoon cornstarch', '1/2 cup, plus 1 tablespoon cornstarch [70 g]'],
['1 1/2 cups granulated cane sugar', '1 1/2 cups granulated cane sugar [300 g]'],
['a cup plus 2 tablespoons', 'a cup plus 2 tablespoons [270 ml]'],
['the edge of the pie plate by 1/2 an inch', 'the edge of the pie plate by 1/2 an inch [1.3 cm]'],
['1/2 cup half and half*', '1/2 cup [120 ml] half and half*'],
['1 pint heavy cream', '1 pint heavy cream [475 g]'],
['to a 9-inch-by-13-inch glass baking dish', 'to a 9-inch-by-13-inch [22.5×32.5 cm] glass baking dish'],
['Grease two 8½ by 4½-inch loaf pans', 'Grease two 8½ by 4½-inch [22×11.5 cm] loaf pans'],
['32 bars, each about 2-1/4 x 1-1/2 inches', '32 bars, each about 2-1/4 x 1-1/2 inches [5.8×3.8 cm]'],
['10 three-fluid-ounce popsicle molds', '10 three-fluid-ounce [90 ml] popsicle molds'],
['⅓ cup light sour cream', '⅓ cup light sour cream [75 g]'],
['⅓ cup nonfat greek vanilla yogurt', '⅓ cup nonfat greek vanilla yogurt [80 g]'],
['about 9/10ths cup', 'about 9/10ths cup [210 ml]'],
['1 1/2 cups cooked wild rice', '1 1/2 cups cooked wild rice [240 g]'],
['1 c sugar', '1 c sugar [200 g]'],
['2 c almond flour', '2 c almond flour [190 g]'],
['Using water that is at about 212 ℉,', 'Using water that is at about 212 ℉ [100 °C],'],
['1/4 cup white or yellow miso paste', '1/4 cup white or yellow miso paste [70 g]'],
['2 ts yeast', '2 ts yeast [6 g]'],
['1 gallon warm water', '1 gallon [3.75 l] warm water'],
['a ratio of about one cup of wine per pound of cheese worked well', 'a ratio of about one cup [240 ml] of wine per pound [450 g] of cheese worked well'],
['the heat exchanged per degree is termed specific heat', 'the heat exchanged per degree is termed specific heat'],
['', ''],
// failing
// false positives
// ['1 x 375g pack of pre-rolled puff pastry', '1 x 375g pack of pre-rolled puff pastry'],
// ['Dip popsicles one by one', 'Dip popsicles one by one'],
['', '']
];
function runTests() {
var failed = 0;
for (var i in tests) {
var result = mc.addMetricUnits(tests[i][0]);
if (result != tests[i][1]) {
console.log('test failed: "%s" -> "%s" (not "%s")', tests[i][0], result, tests[i][1]);
failed++;
}
}
console.log('%d of %d tests passed', tests.length - failed, tests.length);
}
runTests();