Hlint: Warning: Use liftM
This commit is contained in:
		
							parent
							
								
									d6393f5f63
								
							
						
					
					
						commit
						8414f06416
					
				
							
								
								
									
										2
									
								
								Tests.hs
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Tests.hs
									
									
									
									
									
								
							| @ -218,7 +218,7 @@ runtests opts args = do | |||||||
|    else exitWith ExitSuccess |    else exitWith ExitSuccess | ||||||
|     where |     where | ||||||
|       runner | Verbose `elem` opts = runVerboseTests |       runner | Verbose `elem` opts = runVerboseTests | ||||||
|              | otherwise = \t -> runTestTT t >>= return . flip (,) 0 |              | otherwise = liftM (flip (,) 0) . runTestTT | ||||||
|       ts = TestList $ filter matchname $ concatMap tflatten tests |       ts = TestList $ filter matchname $ concatMap tflatten tests | ||||||
|       --ts = tfilter matchname $ TestList tests -- unflattened |       --ts = tfilter matchname $ TestList tests -- unflattened | ||||||
|       matchname = matchpats args . tname |       matchname = matchpats args . tname | ||||||
|  | |||||||
| @ -123,7 +123,7 @@ main = do | |||||||
|   let (opts,exes) = parseargs args |   let (opts,exes) = parseargs args | ||||||
|   when (null exes) $ error $ "at least one executable needed\n" ++ usage |   when (null exes) $ error $ "at least one executable needed\n" ++ usage | ||||||
|   let (file, num) = (fileopt opts, numopt opts) |   let (file, num) = (fileopt opts, numopt opts) | ||||||
|   tests <- readFile file >>= return . filter istest . lines |   tests <- liftM (filter istest . lines) (readFile file) | ||||||
|   now <- getCurrentTime |   now <- getCurrentTime | ||||||
|   putStrLn $ printf "Using %s" file |   putStrLn $ printf "Using %s" file | ||||||
|   putStrLn $ printf "Running %d tests %d times with %d executables at %s:"  |   putStrLn $ printf "Running %d tests %d times with %d executables at %s:"  | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user