Skip to content

Commit

Permalink
more robust test
Browse files Browse the repository at this point in the history
  • Loading branch information
dorchard committed Sep 3, 2024
1 parent 10a45ca commit 4d028b7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/Language/Fortran/Analysis/ModGraphSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ testDependencyList = do
paths' <- expandDirs ["test-data" </> "module"]
mg <- genModGraph (Just Fortran90) ["."] Nothing paths'
let list = modGraphToList mg
let files = ["leaf.f90", "mid1.f90", "mid2.f90", "top.f90"]
let filesWithPaths = map (("test-data" </> "module") </>) files
list `shouldBe` filesWithPaths
-- we should have two possible orderings
let files1 = ["leaf.f90", "mid1.f90", "mid2.f90", "top.f90"]
let filesWithPaths1 = map (("test-data" </> "module") </>) files1
-- or in a different order
let files2 = ["leaf.f90", "mid2.f90", "mid1.f90", "top.f90"]
let filesWithPaths2 = map (("test-data" </> "module") </>) files2
shouldSatisfy list (\x -> x == filesWithPaths1 || x == filesWithPaths2)

0 comments on commit 4d028b7

Please sign in to comment.