From 0a0b3ec5a27d198832023ef5822087beb1ed860f Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 14 Oct 2020 12:59:06 -0500 Subject: Clean up unit tests a bit --- bootstrap/unit_test/SourceConstructionTest.hs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'bootstrap/unit_test/SourceConstructionTest.hs') diff --git a/bootstrap/unit_test/SourceConstructionTest.hs b/bootstrap/unit_test/SourceConstructionTest.hs index 2cee008..24122c5 100644 --- a/bootstrap/unit_test/SourceConstructionTest.hs +++ b/bootstrap/unit_test/SourceConstructionTest.hs @@ -46,18 +46,16 @@ programSourceFileName' :: String programSourceFileName' = "some" "file" "somewhere.f90" checkIsProgram :: Source -> Result -checkIsProgram s = assertThat $ case s of - Program{} -> True - _ -> False +checkIsProgram Program{} = assertThat True +checkIsProgram _ = assertThat False checkProgramSourceFileName :: Source -> Result -checkProgramSourceFileName s = case s of - p@(Program{}) -> - assertEquals programSourceFileName' $ programSourceFileName p - _ -> fail' "wasn't a Program" +checkProgramSourceFileName p@(Program{}) = + assertEquals programSourceFileName' $ programSourceFileName p +checkProgramSourceFileName _ = fail' "wasn't a Program" checkProgramObjectFileName :: Source -> Result -checkProgramObjectFileName s = case s of - p@(Program{}) -> assertEquals ("." "some_file_somewhere.f90.o") +checkProgramObjectFileName p@(Program{}) = + assertEquals ("." "some_file_somewhere.f90.o") $ (programObjectFileName p) "." - _ -> fail' "wasn't a Program" +checkProgramObjectFileName _ = fail' "wasn't a Program" -- cgit v1.2.3