From 311c695aa30f63fc1be0ef8b8c56ca372e01a31e Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 15 Oct 2020 10:47:40 -0500 Subject: Add test for a module's name --- bootstrap/unit_test/ModuleSourceConstructionTest.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bootstrap/unit_test/ModuleSourceConstructionTest.hs') 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" -- cgit v1.2.3