diff options
author | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-15 10:47:40 -0500 |
---|---|---|
committer | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-15 10:47:40 -0500 |
commit | 311c695aa30f63fc1be0ef8b8c56ca372e01a31e (patch) | |
tree | fb50d1452fccbdad137b53478e8addc8358194e9 /bootstrap/unit_test | |
parent | 134713a6c3620bf5b71ceaa2b6bed3a228d1c297 (diff) | |
download | fpm-311c695aa30f63fc1be0ef8b8c56ca372e01a31e.tar.gz fpm-311c695aa30f63fc1be0ef8b8c56ca372e01a31e.zip |
Add test for a module's name
Diffstat (limited to 'bootstrap/unit_test')
-rw-r--r-- | bootstrap/unit_test/ModuleSourceConstructionTest.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bootstrap/unit_test/ModuleSourceConstructionTest.hs b/bootstrap/unit_test/ModuleSourceConstructionTest.hs index 20bc011..26f08b2 100644 --- a/bootstrap/unit_test/ModuleSourceConstructionTest.hs +++ b/bootstrap/unit_test/ModuleSourceConstructionTest.hs @@ -32,6 +32,7 @@ test = return $ givenInput "its object file name is the 'flattened' path of the source file with '.o' appeneded" checkModuleObjectFileName , then' "it knows what modules it uses directly" checkModuleModulesUsed + , then' "it knows its name" checkModuleName ] ] @@ -61,3 +62,7 @@ checkModuleModulesUsed :: Source -> Result checkModuleModulesUsed m@(Module{}) = assertEquals ["module1", "module2"] $ moduleModulesUsed m checkModuleModulesUsed _ = fail' "wasn't a Module" + +checkModuleName :: Source -> Result +checkModuleName m@(Module{}) = assertEquals "some_module" $ moduleName m +checkModuleName _ = fail' "wasn't a Module" |