@@ -3,437 +3,90 @@ module Tests
10−import Test.Tasty
7+import Test.Hspec
11−import Test.Tasty.HUnit
13−tests :: TestTree
9+tests :: Spec
14−tests = testGroup "Tests"
10+tests = do
15− [ testGroup "List Monoids"
11+ it "regroup" $ do
16− [ testCase "FirstMonoid" $ do
12+ regroup (1 :: Int, (2 :: Int, 3 :: Int)) `shouldBe` (2, 1, 3)
17− let getFirst = destructFirstMonoid . fold . fmap constructFirstMonoid
13+ regroup ("1", ("2", "3")) `shouldBe` ("2", "1", "3")
18− getFirst [1 :: Int, 2, 3] @=? Just 1
14+ regroup (True, (False, True)) `shouldBe` (False, True, True)
19− getFirst [] @=? (Nothing :: Maybe ())
15+ it "safeHead" $ do
20− getFirst [True, False] @=? Just True
16+ safeHead [1 :: Int, 2, 3] `shouldBe` Just 1
21− getFirst [True, True, False] @=? Just True
17+ safeHead [1294 :: Int, 2, 3, 4, 5, 6, 7, 7, 9] `shouldBe` Just 1294
22− getFirst [1 .. 1000] @=? Just (1 :: Int)
18+ safeHead [] `shouldBe` (Nothing :: Maybe ())
23− getFirst [100 .. 1000] @=? Just (100 :: Int)
19+ it "safeLast" $ do
24− getFirst [6, 2, 7, 398, 1984, 383, -1020] @=? Just (6 :: Int)
20+ safeLast [1 :: Int, 2, 3] `shouldBe` Just 3
25− , testCase "LastMonoid" $ do
21+ safeLast [1294 :: Int, 2, 3, 4, 5, 6, 7, 7, 9] `shouldBe` Just 9
26− let getLast = destructLastMonoid . fold . fmap constructLastMonoid
22+ safeLast [] `shouldBe` (Nothing :: Maybe ())
27− getLast [1 :: Int, 2, 3] @=? Just 3
23+ it "withoutLast" $ do
28− getLast [] @=? (Nothing :: Maybe ())
24+ withoutLast [1 :: Int, 2, 3] `shouldBe` [1, 2]
29− getLast [1 .. 1000] @=? Just (1000 :: Int)
25+ withoutLast [1294 :: Int, 2, 3, 4, 5, 6, 7, 7, 9] `shouldBe` [1294, 2, 3, 4, 5, 6, 7, 7]
30− getLast [100 .. 10000] @=? Just (10000 :: Int)
26+ withoutLast [] `shouldBe` ([] :: [()])
31− getLast [6, 2, 7, 398, 1984, 383, -1020, 498] @=? Just (498 :: Int)
27+ it "indexed" $ do
32− getLast [True, False] @=? Just False
28+ indexed 2 [1 :: Int, 2, 3] `shouldBe` Just 3
33− getLast [True, True, False] @=? Just False
29+ indexed 0 [1294 :: Int, 2, 3, 4, 5, 6, 7, 7, 9] `shouldBe` Just 1294
34− getLast [True, True, False, True] @=? Just True
30+ indexed 1080 [1294 :: Int, 2, 3, 4, 5, 6, 7, 7, 9] `shouldBe` Nothing
35− ]
31+ indexed 4 [1294 :: Int, 2, 3, 4, 5, 6, 7, 7, 9] `shouldBe` Just 5
36− , testGroup "Todo List" $
32+ indexed 0 [] `shouldBe` (Nothing :: Maybe ())
37− let createTasks :: [(String, Priority)] -> MyTaskManager
33+ indexed 297 [] `shouldBe` (Nothing :: Maybe ())
38− createTasks = foldl (\t (a, b) -> createTask a b t) emptyTaskManager
34+ it "alternating" $ do
39− getPrioritySets :: MyTaskManager -> [[(Completion, String)]]
35+ take 10 alternating `shouldBe` [1, -2, 3, -4, 5, -6, 7, -8, 9, -10]
40− getPrioritySets =
36+ alternating !! 42 `shouldBe` 43
41− fmap (sort . fmap (\(a, _, b) -> (a, b)))
37+ alternating !! 69 `shouldBe` -70
42− . groupBy ((==) `on` (\(_, p, _) -> p))
38+ alternating !! 420 `shouldBe` 421
43− . getPriorityList
39+ it "leftmost" $ do
44− in
40+ (leftmost . constructTree) [1 :: Int, 2, 3, 4, 5] `shouldBe` Just 4
45− [ testCase "emptyTaskManager" $
41+ (leftmost . constructTree) [1 :: Int, 2, 3, 4] `shouldBe` Just 4
46− getPriorityList (emptyTaskManager :: MyTaskManager) @=? []
42+ (leftmost . constructTree) [1 :: Int, 2, 3, 99, 5] `shouldBe` Just 99
47− , testCase "createTask" $ do
43+ (leftmost . constructTree) [8 :: Int, 7, 6, 5, 4, 1, 2, 3, 4, 5] `shouldBe` Just 3
48− getPrioritySets
44+ it "rightmost" $ do
49− ( createTasks
45+ (rightmost . constructTree) [1 :: Int, 2, 3, 4, 5] `shouldBe` Just 3
50− [ ("a", Low),
46+ (rightmost . constructTree) [1 :: Int, 2, 3, 4] `shouldBe` Just 3
51− ("aaa", Medium),
47+ (rightmost . constructTree) [1 :: Int, 2, 99, 5, 5] `shouldBe` Just 99
52− ("AAAAAAAAAA", High)
48+ (rightmost . constructTree) [8 :: Int, 7, 6, 5, 4, 1, 2, 3, 4, 5] `shouldBe` Just 2
53− ]
49+ it "treeSum" $ do
54− )
50+ (treeSum . constructTree) [1, 2, 3, 4, 5] `shouldBe` sum [1, 2, 3, 4, 5]
55− @=? [ [(NotCompleted, "AAAAAAAAAA")],
51+ (treeSum . constructTree) [1, 2, 3, 4] `shouldBe` sum [1, 2, 3, 4]
56− [(NotCompleted, "aaa")],
52+ (treeSum . constructTree) [1, 2, 3, 5, 99] `shouldBe` sum [1, 2, 3, 5, 99]
57− [(NotCompleted, "a")]
53+ (treeSum . constructTree) [8, 7, 6, 5, 4, 1, 2, 3, 4, 5] `shouldBe` sum [8, 7, 6, 5, 4, 1, 2, 3, 4, 5]
58− ]
54+ (treeSum . constructTree . take 100) [5 ..] `shouldBe` (sum . take 100) [5 ..]
59− getPrioritySets
55+ (treeSum . constructTree . take 100) [2 ..] `shouldBe` (sum . take 100) [2 ..]
60− ( createTasks
56+ it "treeSize" $ do
61− [ ("a", Low),
57+ let test list = treeSize (constructTree list) `shouldBe` fromIntegral (length list)
62− ("AAAAAAAAAA", High)
58+ test $ replicate 11 ()
63− ]
59+ test $ replicate 16 (8 :: Int)
64− )
60+ test [5, 2, 5, 7, 7, 3, 2, 7, 7 :: Int]
65− @=? [ [(NotCompleted, "AAAAAAAAAA")],
61+ it "insert" $ do
66− [(NotCompleted, "a")]
62+ constructTree [1 :: Int] `shouldNotBe` constructTree [1, 2]
67− ]
63+ constructTree [1 :: Int] `shouldNotBe` constructTree []
68− getPrioritySets
64+ (insert 3 . insert 1 . insert 2 . constructTree) [] `shouldBe` constructTree [2, 1, 3]
69− ( createTasks
65+ (insert 71 . insert 65 . insert 56 . insert 54 . insert 45 . insert 35 . insert 15 . insert 5 . constructTree) [50, 30, 60, 10, 55, 40, 70]
70− [ ("a", Low),
66+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
71− ("AAAAAAAAAA", High),
67+ (insert 71 . insert 54 . insert 45 . insert 35 . insert 15 . insert 65 . insert 56 . insert 5 . constructTree) [50, 30, 60, 10, 55, 40, 70]
72− ("aaa", Medium),
68+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
73− ("oh HaiMark", Medium)
69+ (insert 35 . insert 15 . insert 65 . insert 71 . insert 54 . insert 45 . insert 56 . insert 5 . constructTree) [50, 30, 60, 10, 55, 40, 70]
74− ]
70+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
75− )
71+ (insert 35 . insert 54 . insert 45 . insert 56 . insert 5 . insert 15 . insert 65 . insert 71 . constructTree) [50, 30, 60, 10, 55, 40, 70]
76− @=? [ [(NotCompleted, "AAAAAAAAAA")],
72+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
77− [(NotCompleted, "aaa"), (NotCompleted, "oh HaiMark")],
73+ (insert 56 . insert 5 . insert 15 . insert 65 . insert 35 . insert 54 . insert 45 . insert 71 . constructTree) [50, 30, 60, 10, 55, 40, 70]
78− [(NotCompleted, "a")]
74+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
79− ]
75+ (insert 56 . insert 56 . insert 5 . insert 5 . insert 15 . insert 65 . insert 35 . insert 54 . insert 45 . insert 71 . constructTree) [50, 30, 60, 10, 55, 40, 70]
80− getPrioritySets
76+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
81− ( createTasks
77+ it "insertAll" $ do
82− [ ("a", Low),
78+ constructTree [1 :: Int] `shouldNotBe` constructTree [1, 2]
83− ("AAAAAAAAAA", High),
79+ constructTree [1 :: Int] `shouldNotBe` constructTree []
84− ("aaa", Medium),
80+ (insertAll [2, 3, 1] . constructTree) [] `shouldBe` constructTree [2, 1, 3]
85− ("oh HaiMark", Medium),
81+ (insertAll [71, 65, 56, 54, 45, 35, 15, 5] . constructTree) [50, 30, 60, 10, 55, 40, 70]
86− ("OH NO", High)
82+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
87− ]
83+ (insertAll [71, 54, 45, 35, 15, 65, 56, 5] . constructTree) [50, 30, 60, 10, 55, 40, 70]
88− )
84+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
89− @=? [ [(NotCompleted, "AAAAAAAAAA"), (NotCompleted, "OH NO")],
85+ (insertAll [35, 15, 65, 71, 54, 45, 56, 5] . constructTree) [50, 30, 60, 10, 55, 40, 70]
90− [(NotCompleted, "aaa"), (NotCompleted, "oh HaiMark")],
86+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
91− [(NotCompleted, "a")]
87+ (insertAll [35, 54, 45, 56, 5, 15, 65, 71] . constructTree) [50, 30, 60, 10, 55, 40, 70]
92− ]
88+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
93− , testCase "toggleTaskCompletion" $ do
89+ (insertAll [56, 5, 15, 65, 35, 54, 45, 71] . constructTree) [50, 30, 60, 10, 55, 40, 70]
94− getPrioritySets
90+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
95− ( toggleTaskCompletion "AAAAAAAAAA" . createTasks $
91+ (insertAll [56, 5, 15, 65, 35, 54, 45, 71, 5, 56, 35] . constructTree) [50, 30, 60, 10, 55, 40, 70]
96− [ ("a", Low),
92+ `shouldBe` constructTree [50, 30, 60, 10, 55, 40, 70, 5, 54, 35, 65, 15, 56, 45, 71]
97− ("AAAAAAAAAA", High),
99− ("oh HaiMark", Medium),
103− @=? [ [(Completed, "AAAAAAAAAA"), (NotCompleted, "OH NO")],
104− [(NotCompleted, "aaa"), (NotCompleted, "oh HaiMark")],
105− [(NotCompleted, "a")]
108− ( toggleTaskCompletion "AAAAAAAAAA" . toggleTaskCompletion "AAAAAAAAAA" . createTasks $
110− ("AAAAAAAAAA", High),
112− ("oh HaiMark", Medium),
116− @=? [ [(NotCompleted, "AAAAAAAAAA"), (NotCompleted, "OH NO")],
117− [(NotCompleted, "aaa"), (NotCompleted, "oh HaiMark")],
118− [(NotCompleted, "a")]
121− ( toggleTaskCompletion "a"
122− . toggleTaskCompletion "not here"
123− . toggleTaskCompletion "AAAAAAAAAA"
126− ("AAAAAAAAAA", High),
128− ("oh HaiMark", Medium),
132− @=? [ [(Completed, "AAAAAAAAAA"), (NotCompleted, "OH NO")],
133− [(NotCompleted, "aaa"), (NotCompleted, "oh HaiMark")],
136− , testCase "removeTask" $ do
138− ( removeTask "AAAAAAAAAA"
141− ("AAAAAAAAAA", High),
143− ("oh HaiMark", Medium),
147− @=? [ [(NotCompleted, "OH NO")],
148− [(NotCompleted, "aaa"), (NotCompleted, "oh HaiMark")],
149− [(NotCompleted, "a")]
152− ( removeTask "AAAAAAAAAA" . removeTask "AAAAAAAAAA"
155− ("AAAAAAAAAA", High),
157− ("oh HaiMark", Medium),
161− @=? [ [(NotCompleted, "OH NO")],
162− [(NotCompleted, "aaa"), (NotCompleted, "oh HaiMark")],
163− [(NotCompleted, "a")]
166− ( removeTask "aaa" . removeTask "oh HaiMark"
167− . removeTask "AAAAAAAAAA"
168− . removeTask "AAAAAAAAAA"
171− ("AAAAAAAAAA", High),
173− ("oh HaiMark", Medium),
177− @=? [ [(NotCompleted, "OH NO")],
178− [(NotCompleted, "a")]
180− , testCase "modifyPriority" $ do
182− ( modifyPriority "aaa" High . createTasks $
184− ("AAAAAAAAAA", High),
186− ("oh HaiMark", Medium),
190− @=? [ [(NotCompleted, "AAAAAAAAAA"), (NotCompleted, "OH NO"), (NotCompleted, "aaa")],
191− [(NotCompleted, "oh HaiMark")],
192− [(NotCompleted, "a")]
195− ( modifyPriority "aaa" High
196− . toggleTaskCompletion "a"
197− . modifyPriority "a" High
200− ("AAAAAAAAAA", High),
202− ("oh HaiMark", Medium),
206− @=? [ [ (Completed, "a"),
207− (NotCompleted, "AAAAAAAAAA"),
208− (NotCompleted, "OH NO"),
209− (NotCompleted, "aaa")
211− [(NotCompleted, "oh HaiMark")]
214− ( modifyPriority "aaa" High
215− . modifyPriority "a" High
216− . modifyPriority "a" High
217− . modifyPriority "oh HaiMark" High
220− ("AAAAAAAAAA", High),
222− ("oh HaiMark", Medium),
226− @=? [ [ (NotCompleted, "AAAAAAAAAA"),
227− (NotCompleted, "OH NO"),
228− (NotCompleted, "a"),
229− (NotCompleted, "aaa"),
230− (NotCompleted, "oh HaiMark")
234− ( modifyPriority "aaa" High
235− . modifyPriority "a" High
236− . modifyPriority "ntestCase here sihji" High
237− . modifyPriority "oh HaiMark" Low
238− . modifyPriority "a" High
239− . modifyPriority "oh HaiMark" High
242− ("AAAAAAAAAA", High),
244− ("oh HaiMark", Medium),
248− @=? [ [ (NotCompleted, "AAAAAAAAAA"),
249− (NotCompleted, "OH NO"),
250− (NotCompleted, "a"),
251− (NotCompleted, "aaa")
253− [(NotCompleted, "oh HaiMark")]
255− , testCase "renameTask" $ do
257− ( renameTask "AAAAAAAAAA" "henlo"
260− ("AAAAAAAAAA", High),
262− ("oh HaiMark", Medium),
266− @=? [ [(NotCompleted, "OH NO"), (NotCompleted, "henlo")],
267− [(NotCompleted, "aaa"), (NotCompleted, "oh HaiMark")],
268− [(NotCompleted, "a")]
271− ( renameTask "AAAAAAAAAA" "henlo"
272− . toggleTaskCompletion "a"
273− . renameTask "oh HaiMark" "iz task"
276− ("AAAAAAAAAA", High),
278− ("oh HaiMark", Medium),
282− @=? [ [(NotCompleted, "OH NO"), (NotCompleted, "henlo")],
283− [(NotCompleted, "aaa"), (NotCompleted, "iz task")],
287− ( renameTask "AAAAAAAAAA" "henlo"
288− . toggleTaskCompletion "iz task"
289− . renameTask "oh HaiMark" "iz task"
290− . renameTask "iz not here" "ajajaj"
293− ("AAAAAAAAAA", High),
295− ("oh HaiMark", Medium),
299− @=? [ [(NotCompleted, "OH NO"), (NotCompleted, "henlo")],
300− [(Completed, "iz task"), (NotCompleted, "aaa")],
301− [(NotCompleted, "a")]
304− , testGroup "Coffee"
305− [ testCase "HasPrice Coffee" $ do
306− price (Coffee 2 [OatMilk, Cinnamon]) @=? 2 + price OatMilk + price Cinnamon
307− price (Coffee 2 [Cinnamon, Cinnamon]) @=? 2 + price Cinnamon + price Cinnamon
308− price (Coffee 2 []) @=? 2
309− price (Coffee 2 [Cinnamon, Cream, Cinnamon])
314− , testCase "chargeCoffee" $ do
315− chargeCoffee (Coffee 2 [OatMilk, Cinnamon]) (DebitCard 199 69)
316− @=? Just (DebitCard 112 69)
317− chargeCoffee (Coffee 2 [OatMilk, Cinnamon]) (DebitCard 87 69)
318− @=? Just (DebitCard 0 69)
319− chargeCoffee (Coffee 2 [OatMilk, Cinnamon]) (DebitCard 86 69)
321− chargeCoffee (Coffee 2 [OatMilk, Cinnamon]) (DebitCard 0 69)
323− chargeCoffee (Coffee 2 [OatMilk, Cinnamon]) (DebitCard (-2189) 69)
325− chargeCoffee (Coffee 2 [OatMilk, Cinnamon, WhiteSugar]) (DebitCard 199 69)
326− @=? Just (DebitCard 97 69)
327− chargeCoffee (Coffee 2 [WhiteSugar, OatMilk, Cinnamon, WhiteSugar]) (DebitCard 199 69)
328− @=? Just (DebitCard 82 69)
329− , let coffee = Coffee 2 [OatMilk, Cinnamon]
330− in testCase "payForCoffee" $ do
331− payForCoffee (Customer [DebitCard 199 69] 0) coffee
332− @=? Just (Card (DebitCard 112 69))
333− payForCoffee (Customer [DebitCard 86 12, DebitCard 199 69] 2) coffee
334− @=? Just (Card (DebitCard 112 69))
335− payForCoffee (Customer [DebitCard (-12) 8, DebitCard 86 12, DebitCard 199 69] 0) coffee
336− @=? Just (Card (DebitCard 112 69))
337− payForCoffee (Customer [DebitCard 87 8, DebitCard 111 12, DebitCard 199 69] 0) coffee
338− @=? Just (Card (DebitCard 0 8))
339− payForCoffee (Customer [DebitCard 86 8, DebitCard 86 12, DebitCard 82 69] 0) coffee
341− payForCoffee (Customer [DebitCard 86 8, DebitCard 86 12, DebitCard 82 69] 87) coffee
343− payForCoffee (Customer [DebitCard 86 8, DebitCard 86 12, DebitCard 81 69] 86) coffee
345− , testCase "applyPayment" $ do
346− applyPayment (Customer [DebitCard 199 69] 0) (Card (DebitCard 112 69))
347− @=? Customer [DebitCard 112 69] 0
348− applyPayment (Customer [DebitCard 111 12, DebitCard 199 69] 2) (Card (DebitCard 112 69))
349− @=? Customer [DebitCard 111 12, DebitCard 112 69] 2
350− applyPayment (Customer [DebitCard (-12) 8, DebitCard 111 12, DebitCard 199 69] 0) (Card (DebitCard 112 69))
351− @=? Customer [DebitCard (-12) 8, DebitCard 111 12, DebitCard 112 69] 0
352− applyPayment (Customer [DebitCard 112 8, DebitCard 111 12, DebitCard 199 69] 0) (Card (DebitCard 0 8))
353− @=? Customer [DebitCard 0 8, DebitCard 111 12, DebitCard 199 69] 0
354− applyPayment (Customer [DebitCard 111 8, DebitCard 111 12, DebitCard 110 69] 112) (Cash 0)
355− @=? Customer [DebitCard 111 8, DebitCard 111 12, DebitCard 110 69] 0
356− applyPayment (Customer [DebitCard 111 8, DebitCard 111 12, DebitCard 110 69] 112) (Card (DebitCard 0 13))
357− @=? Customer [DebitCard 111 8, DebitCard 111 12, DebitCard 110 69] 112
358− , let coffee = Coffee 2 [OatMilk, Cinnamon]
359− in testCase "buyCoffee" $ do
360− buyCoffee (Customer [DebitCard 199 69] 0) coffee
361− @=? Just (Customer [DebitCard 112 69] 0)
362− buyCoffee (Customer [DebitCard 86 12, DebitCard 199 69] 2) coffee
363− @=? Just (Customer [DebitCard 86 12, DebitCard 112 69] 2)
364− buyCoffee (Customer [DebitCard (-12) 8, DebitCard 86 12, DebitCard 199 69] 0) coffee
365− @=? Just (Customer [DebitCard (-12) 8, DebitCard 86 12, DebitCard 112 69] 0)
366− buyCoffee (Customer [DebitCard 87 8, DebitCard 86 12, DebitCard 199 69] 0) coffee
367− @=? Just (Customer [DebitCard 0 8, DebitCard 86 12, DebitCard 199 69] 0)
368− buyCoffee (Customer [DebitCard 86 8, DebitCard 86 12, DebitCard 84 69] 0) coffee
370− buyCoffee (Customer [DebitCard 86 8, DebitCard 86 12, DebitCard 82 69] 87) coffee
371− @=? Just (Customer [DebitCard 86 8, DebitCard 86 12, DebitCard 82 69] 0)
372− buyCoffee (Customer [DebitCard 86 8, DebitCard 86 12, DebitCard 81 69] 86) coffee
374− , testCase "saveTheDiabetic" $ do
376− [ Coffee 0 [WhiteSugar, BrownSugar, Cinnamon],
377− Coffee 0 [WhiteSugar, BrownSugar, Cinnamon],
378− Coffee 0 [WhiteSugar, BrownSugar, Cinnamon]
381− [ Coffee 0 [Cinnamon],
382− Coffee 0 [Cinnamon],
387− [ Coffee 0 [WhiteSugar, BrownSugar, Cinnamon, BrownSugar, SoyMilk],
388− Coffee 0 [WhiteSugar, BrownSugar, WhiteSugar, WhiteSugar, Cinnamon],
389− Coffee 0 [WhiteSugar, BrownSugar, Cinnamon]
392− [ Coffee 0 [Cinnamon, SoyMilk],
393− Coffee 0 [Cinnamon],
398− [ Coffee 0 [Cinnamon, SoyMilk],
399− Coffee 0 [Cinnamon],
400− Coffee 0 [Cinnamon],
404− [ Coffee 0 [Cinnamon, SoyMilk],
405− Coffee 0 [Cinnamon],
406− Coffee 0 [Cinnamon],
415− , testCase "calculateSugarDanger" $ do
416− calculateSugarDanger
417− [ Coffee 0 [WhiteSugar, BrownSugar, Cinnamon],
418− Coffee 0 [WhiteSugar, BrownSugar, Cinnamon],
419− Coffee 0 [WhiteSugar, BrownSugar, Cinnamon]
422− calculateSugarDanger
423− [ Coffee 0 [WhiteSugar, BrownSugar, Cinnamon, BrownSugar, SoyMilk],
424− Coffee 0 [WhiteSugar, BrownSugar, WhiteSugar, WhiteSugar, Cinnamon],
425− Coffee 0 [WhiteSugar, BrownSugar, Cinnamon],
429− calculateSugarDanger
430− [ Coffee 0 [Cinnamon, SoyMilk],
431− Coffee 0 [Cinnamon],
435− calculateSugarDanger