diff options
author | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-20 14:36:30 -0500 |
---|---|---|
committer | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-20 14:36:30 -0500 |
commit | 0799961cdd047005021549c32d8f8d7731f40d27 (patch) | |
tree | 1cf86eaab40ac47e8ed66ec32f58b0479eb66039 /bootstrap/unit_test | |
parent | 55590e78dd6df0eac312eaadfc230533adfe0018 (diff) | |
download | fpm-0799961cdd047005021549c32d8f8d7731f40d27.tar.gz fpm-0799961cdd047005021549c32d8f8d7731f40d27.zip |
Split submodule name into two components
Diffstat (limited to 'bootstrap/unit_test')
-rw-r--r-- | bootstrap/unit_test/SubmoduleSourceConstructionTest.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs b/bootstrap/unit_test/SubmoduleSourceConstructionTest.hs index 577207e..d07a6ed 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 parent's name" checkSubmoduleParentName , then' "it knows its name" checkSubmoduleName ] ] @@ -68,7 +69,11 @@ checkSubmoduleModulesUsed s@(Submodule{}) = assertEquals ["module1", "module2"] $ submoduleModulesUsed s checkSubmoduleModulesUsed _ = fail' "wasn't a Submodule" +checkSubmoduleParentName :: Source -> Result +checkSubmoduleParentName s@(Submodule{}) = + assertEquals "some_module@parent" (submoduleParentName s) +checkSubmoduleParentName _ = fail' "wasn't a Submodule" + checkSubmoduleName :: Source -> Result -checkSubmoduleName s@(Submodule{}) = - assertEquals "some_module@parent@child" $ submoduleName s -checkSubmoduleName _ = fail' "wasn't a Submodule" +checkSubmoduleName s@(Submodule{}) = assertEquals "child" $ submoduleName s +checkSubmoduleName _ = fail' "wasn't a Submodule" |