tracks/haskell/exercises/pov/test/Tests.hs in trackler-2.2.1.135 vs tracks/haskell/exercises/pov/test/Tests.hs in trackler-2.2.1.136
- old
+ new
@@ -72,10 +72,16 @@
tracePathBetween "a" "c" flat
`shouldBe` Just [ "a"
, "root"
, "c" ]
+ it "Can find path not involving root" $
+ tracePathBetween "x" "sibling-1" rootNotNeeded
+ `shouldBe` Just [ "x"
+ , "parent"
+ , "sibling-1" ]
+
it "Cannot trace if destination does not exist" $
tracePathBetween "x" "NOT THERE" cousins
`shouldBe` Nothing
it "Cannot trace if source does not exist" $
@@ -194,5 +200,14 @@
, leaf "cousin-1"
]
]
]
]
+
+rootNotNeeded :: Tree String
+rootNotNeeded = Node "grandparent"
+ [ Node "parent"
+ [ leaf "x"
+ , leaf "sibling-0"
+ , leaf "sibling-1"
+ ]
+ ]