diff options
author | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-19 16:13:53 -0500 |
---|---|---|
committer | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-19 16:13:53 -0500 |
commit | 28b00953f12d2fc0de9de75f26fd3c4346a44974 (patch) | |
tree | 815db4fcb9b0234695067cbff2bbd87a6c68e3f7 /bootstrap/unit_test | |
parent | f038a093bc0259bf7d72d86fb95f4a2aebf1a8df (diff) | |
download | fpm-28b00953f12d2fc0de9de75f26fd3c4346a44974.tar.gz fpm-28b00953f12d2fc0de9de75f26fd3c4346a44974.zip |
Add test for a submodule's name
Diffstat (limited to 'bootstrap/unit_test')
-rw-r--r-- | bootstrap/unit_test/SubmoduleSourceConstructionTest.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs b/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs index 956d782..577207e 100644 --- a/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs +++ b/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs @@ -32,6 +32,7 @@ test = return $ givenInput "its object file name is the 'flattened' path of the source file with '.o' appeneded" checkSubmoduleObjectFileName , then' "it knows what modules it uses directly" checkSubmoduleModulesUsed + , then' "it knows its name" checkSubmoduleName ] ] @@ -66,3 +67,8 @@ checkSubmoduleModulesUsed :: Source -> Result checkSubmoduleModulesUsed s@(Submodule{}) = assertEquals ["module1", "module2"] $ submoduleModulesUsed s checkSubmoduleModulesUsed _ = fail' "wasn't a Submodule" + +checkSubmoduleName :: Source -> Result +checkSubmoduleName s@(Submodule{}) = + assertEquals "some_module@parent@child" $ submoduleName s +checkSubmoduleName _ = fail' "wasn't a Submodule" |