1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

Move PatchOutput into Renderer.

This commit is contained in:
Rob Rix 2016-02-25 13:14:56 -07:00
parent d1adc16f75
commit c710b3c713
5 changed files with 7 additions and 7 deletions

View File

@ -10,7 +10,7 @@ import System.Directory
import System.FilePath
import qualified System.IO as IO
import qualified Data.Text.Lazy.IO as TextIO
import qualified PatchOutput
import qualified Renderer.PatchOutput as PO
import Rainbow
-- | The available types of diff rendering.
@ -35,4 +35,4 @@ printDiff parser arguments sources = case format arguments of
then path </> (takeFileName outputPath -<.> ".html")
else path
IO.withFile outputPath IO.WriteMode (flip TextIO.hPutStr rendered)
Patch -> putStr =<< diffFiles parser PatchOutput.patch sources
Patch -> putStr =<< diffFiles parser PO.patch sources

View File

@ -24,7 +24,7 @@ library
, Row
, Data.OrderedMap
, Patch
, PatchOutput
, Renderer.PatchOutput
, SES
, Category
, Term

View File

@ -1,4 +1,4 @@
module PatchOutput (
module Renderer.PatchOutput (
patch,
hunks
) where

View File

@ -1,7 +1,7 @@
module CorpusSpec where
import Diffing
import PatchOutput
import qualified Renderer.PatchOutput as PO
import Renderer
import Split
import Unified
@ -43,7 +43,7 @@ spec = parallel $ do
correctTests paths@(_, _, Nothing, Nothing, Nothing) = testsForPaths paths
correctTests paths = List.filter (\(_, _, _, _, output) -> isJust output) $ testsForPaths paths
testsForPaths :: (FilePath, FilePath, Maybe FilePath, Maybe FilePath, Maybe FilePath) -> [(String, Renderer a String, FilePath, FilePath, Maybe FilePath)]
testsForPaths (a, b, patch, split, unified) = [ ("patch", PatchOutput.patch, a, b, patch), ("split", testSplit, a, b, split), ("unified", testUnified, a, b, unified) ]
testsForPaths (a, b, patch, split, unified) = [ ("patch", PO.patch, a, b, patch), ("split", testSplit, a, b, split), ("unified", testUnified, a, b, unified) ]
testSplit :: Renderer a String
testSplit diff sources = TL.unpack $ Split.split diff sources
testUnified :: Renderer a String

View File

@ -1,7 +1,7 @@
module PatchOutputSpec where
import Diff
import PatchOutput
import Renderer.PatchOutput
import Range
import Source
import Syntax