aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/unit_test
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-10-15 10:28:02 -0500
committerBrad Richardson <everythingfunctional@protonmail.com>2020-10-15 10:28:02 -0500
commit84884be16503e506cd5ad7f927297fd7d25de779 (patch)
treec991207d12d4baae29ed13d8048bdc7ae26c3b58 /bootstrap/unit_test
parentc2638957dd9aca90831e0b434fec9ccc05c77acc (diff)
downloadfpm-84884be16503e506cd5ad7f927297fd7d25de779.tar.gz
fpm-84884be16503e506cd5ad7f927297fd7d25de779.zip
Add test for module object file name
Diffstat (limited to 'bootstrap/unit_test')
-rw-r--r--bootstrap/unit_test/ModuleSourceConstructionTest.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/bootstrap/unit_test/ModuleSourceConstructionTest.hs b/bootstrap/unit_test/ModuleSourceConstructionTest.hs
index fae7c89..fd69844 100644
--- a/bootstrap/unit_test/ModuleSourceConstructionTest.hs
+++ b/bootstrap/unit_test/ModuleSourceConstructionTest.hs
@@ -28,6 +28,9 @@ test = return $ givenInput
[ then' "it is a Module" checkIsModule
, then' "its source file name is the same as the original"
checkModuleSourceFileName
+ , then'
+ "its object file name is the 'flattened' path of the source file with '.o' appeneded"
+ checkModuleObjectFileName
]
]
@@ -46,3 +49,9 @@ checkModuleSourceFileName :: Source -> Result
checkModuleSourceFileName m@(Module{}) =
assertEquals moduleSourceFileName' $ moduleSourceFileName m
checkModuleSourceFileName _ = fail' "wasn't a Module"
+
+checkModuleObjectFileName :: Source -> Result
+checkModuleObjectFileName m@(Module{}) =
+ assertEquals ("." </> "some_file_somewhere.f90.o")
+ $ (moduleObjectFileName m) "."
+checkModuleObjectFileName _ = fail' "wasn't a Module"