aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-10-19 15:42:22 -0500
committerBrad Richardson <everythingfunctional@protonmail.com>2020-10-19 15:42:22 -0500
commita981372352e881d1cc7d542628959c0ac501e96e (patch)
tree3799ec4d4f9e2df106274ff043b68fcc8973825d /bootstrap/unit_test/SubmoduleSourceConstructionTest.hs
parentb927218b5690fe7cd4080af53831311d59db6987 (diff)
downloadfpm-a981372352e881d1cc7d542628959c0ac501e96e.tar.gz
fpm-a981372352e881d1cc7d542628959c0ac501e96e.zip
Add test for submodule object file name
Diffstat (limited to 'bootstrap/unit_test/SubmoduleSourceConstructionTest.hs')
-rw-r--r--bootstrap/unit_test/SubmoduleSourceConstructionTest.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs b/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs
index 6158939..5295a97 100644
--- a/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs
+++ b/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs
@@ -28,6 +28,9 @@ test = return $ givenInput
[ then' "it is a Submodule" checkIsSubmodule
, then' "its source file name is the same as the original"
checkSubmoduleSourceFileName
+ , then'
+ "its object file name is the 'flattened' path of the source file with '.o' appeneded"
+ checkSubmoduleObjectFileName
]
]
@@ -46,3 +49,9 @@ checkSubmoduleSourceFileName :: Source -> Result
checkSubmoduleSourceFileName s@(Submodule{}) =
assertEquals submoduleSourceFileName' $ submoduleSourceFileName s
checkSubmoduleSourceFileName _ = fail' "wasn't a Submodule"
+
+checkSubmoduleObjectFileName :: Source -> Result
+checkSubmoduleObjectFileName s@(Submodule{}) =
+ assertEquals ("." </> "some_file_somewhere.f90.o")
+ $ (submoduleObjectFileName s) "."
+checkSubmoduleObjectFileName _ = fail' "wasn't a Submodule"