tasty-golden 2.3.2.1 → 2.3.3
raw patch · 17 files changed
+8389/−60 lines, 17 filesdep −temporary-rcdep ~basedep ~bytestringdep ~tastynew-component:exe:examplePVP ok
version bump matches the API change (PVP)
Dependencies removed: temporary-rc
Dependency ranges changed: base, bytestring, tasty
API changes (from Hackage documentation)
+ Test.Tasty.Golden: SizeCutoff :: Int64 -> SizeCutoff
+ Test.Tasty.Golden: createDirectoriesAndWriteFile :: FilePath -> ByteString -> IO ()
+ Test.Tasty.Golden: newtype SizeCutoff
Files
- CHANGELOG.md +7/−0
- Test/Tasty/Golden.hs +68/−38
- Test/Tasty/Golden/Internal.hs +17/−0
- example/example.hs +41/−0
- example/golden/fail/goldenVsFile.golden +1000/−0
- example/golden/fail/goldenVsFileDiff.golden +1000/−0
- example/golden/fail/goldenVsString.golden +1000/−0
- example/golden/fail/goldenVsStringDiff.golden +1000/−0
- example/golden/success/goldenVsFile.golden +1000/−0
- example/golden/success/goldenVsFileDiff.golden +1000/−0
- example/golden/success/goldenVsString.golden +1000/−0
- example/golden/success/goldenVsStringDiff.golden +1000/−0
- tasty-golden.cabal +39/−6
- tests/golden/after-accept.golden +13/−0
- tests/golden/before-accept.golden +120/−0
- tests/golden/with-accept.golden +17/−0
- tests/test.hs +67/−16
CHANGELOG.md view
@@ -1,6 +1,13 @@ Changes ======= +Version 2.3.3+-------------++* Expose `createDirectoriesAndWriteFile`+* Add `--size-cutoff` to truncate large golden test output+* Restore support for GHC >= 7.8+ Version 2.3.2.1 ---------------
Test/Tasty/Golden.hs view
@@ -45,22 +45,25 @@ as binary does the job. -} -{-# LANGUAGE CPP #-}+{-# LANGUAGE OverloadedStrings #-} module Test.Tasty.Golden ( goldenVsFile , goldenVsString , goldenVsFileDiff , goldenVsStringDiff+ , SizeCutoff(..) , writeBinaryFile , findByExtension+ , createDirectoriesAndWriteFile ) where -import Test.Tasty.Providers+import Test.Tasty import Test.Tasty.Golden.Advanced+import Test.Tasty.Golden.Internal import Text.Printf-import qualified Data.ByteString as BS-import qualified Data.ByteString.Lazy as LBS+import qualified Data.ByteString.Lazy.Char8 as LBS+import Data.Monoid import System.IO import System.IO.Temp import System.Process@@ -69,7 +72,6 @@ import System.Directory import Control.Exception import Control.Monad-import Control.DeepSeq import qualified Data.Set as Set -- | Compare the output file's contents against the golden file's contents@@ -83,8 +85,8 @@ goldenVsFile name ref new act = goldenTest name- (BS.readFile ref)- (act >> BS.readFile new)+ (readFileStrict ref)+ (act >> readFileStrict new) cmp upd where@@ -98,25 +100,20 @@ -> IO LBS.ByteString -- ^ action that returns a string -> TestTree -- ^ the test verifies that the returned string is the same as the golden file contents goldenVsString name ref act =+ askOption $ \sizeCutoff -> goldenTest name- (BS.readFile ref)- (toStrict <$> act)- cmp+ (readFileStrict ref)+ act+ (cmp sizeCutoff) upd where- cmp x y = simpleCmp msg x y+ cmp sizeCutoff x y = simpleCmp msg x y where- msg = printf "Test output was different from '%s'. It was: %s" ref (show y)+ msg = printf "Test output was different from '%s'. It was:\n" ref <>+ LBS.unpack (truncateLargeOutput sizeCutoff y) upd = createDirectoriesAndWriteFile ref -toStrict :: LBS.ByteString -> BS.ByteString-#if MIN_VERSION_bytestring(0,10,0)-toStrict = LBS.toStrict-#else-toStrict = BS.concat . LBS.toChunks-#endif- simpleCmp :: Eq a => String -> a -> a -> IO (Maybe String) simpleCmp e x y = return $ if x == y then Nothing else Just e@@ -136,27 +133,28 @@ -> IO () -- ^ action that produces the output file -> TestTree goldenVsFileDiff name cmdf ref new act =+ askOption $ \sizeCutoff -> goldenTest name (return ()) act- cmp+ (cmp sizeCutoff) upd where cmd = cmdf ref new- cmp _ _ | null cmd = error "goldenVsFileDiff: empty command line"- cmp _ _ = do+ cmp sizeCutoff _ _+ | null cmd = error "goldenVsFileDiff: empty command line"+ | otherwise = do (_, Just sout, _, pid) <- createProcess (proc (head cmd) (tail cmd)) { std_out = CreatePipe } -- strictly read the whole output, so that the process can terminate- out <- hGetContents sout- evaluate . rnf $ out+ out <- hGetContentsStrict sout r <- waitForProcess pid return $ case r of ExitSuccess -> Nothing- _ -> Just out+ _ -> Just . LBS.unpack . truncateLargeOutput sizeCutoff $ out - upd _ = BS.readFile new >>= createDirectoriesAndWriteFile ref+ upd _ = readFileStrict new >>= createDirectoriesAndWriteFile ref -- | Same as 'goldenVsString', but invokes an external diff command. goldenVsStringDiff@@ -172,18 +170,19 @@ -> IO LBS.ByteString -- ^ action that returns a string -> TestTree goldenVsStringDiff name cmdf ref act =+ askOption $ \sizeCutoff -> goldenTest name- (BS.readFile ref)- (toStrict <$> act)- cmp+ (readFileStrict ref)+ (act)+ (cmp sizeCutoff) upd where- template = takeFileName ref <.> "actual"- cmp _ actBS = withSystemTempFile template $ \tmpFile tmpHandle -> do+ template = takeBaseName ref <.> "actual"+ cmp sizeCutoff _ actBS = withSystemTempFile template $ \tmpFile tmpHandle -> do -- Write act output to temporary ("new") file- BS.hPut tmpHandle actBS >> hFlush tmpHandle+ LBS.hPut tmpHandle actBS >> hFlush tmpHandle let cmd = cmdf ref tmpFile @@ -191,16 +190,26 @@ (_, Just sout, _, pid) <- createProcess (proc (head cmd) (tail cmd)) { std_out = CreatePipe } -- strictly read the whole output, so that the process can terminate- out <- hGetContents sout- evaluate . rnf $ out+ out <- hGetContentsStrict sout r <- waitForProcess pid return $ case r of ExitSuccess -> Nothing- _ -> Just (printf "Test output was different from '%s'. Output of %s:\n%s" ref (show cmd) out)+ _ -> Just (printf "Test output was different from '%s'. Output of %s:\n" ref (show cmd) <> LBS.unpack (truncateLargeOutput sizeCutoff out)) - upd = BS.writeFile ref+ upd = createDirectoriesAndWriteFile ref +truncateLargeOutput+ :: SizeCutoff+ -> LBS.ByteString+ -> LBS.ByteString+truncateLargeOutput (SizeCutoff n) str =+ if LBS.length str <= n+ then str+ else+ LBS.take n str <> "<truncated>" <>+ "\nUse --accept or increase --size-cutoff to see full output."+ -- | Like 'writeFile', but uses binary mode. writeBinaryFile :: FilePath -> String -> IO () writeBinaryFile f txt = withBinaryFile f WriteMode (\hdl -> hPutStr hdl txt)@@ -250,11 +259,32 @@ -- missing. createDirectoriesAndWriteFile :: FilePath- -> BS.ByteString+ -> LBS.ByteString -> IO () createDirectoriesAndWriteFile path bs = do let dir = takeDirectory path createDirectoryIfMissing True -- create parents too dir- BS.writeFile path bs+ LBS.writeFile path bs++-- | Force the evaluation of a lazily-produced bytestring.+--+-- This is important to close the file handles.+--+-- See <https://ro-che.info/articles/2015-05-28-force-list>.+forceLbs :: LBS.ByteString -> ()+forceLbs = LBS.foldr seq ()++readFileStrict :: FilePath -> IO LBS.ByteString+readFileStrict path = do+ s <- LBS.readFile path+ evaluate $ forceLbs s+ return s++hGetContentsStrict :: Handle -> IO LBS.ByteString+hGetContentsStrict h = do+ hSetBinaryMode h True+ s <- LBS.hGetContents h+ evaluate $ forceLbs s+ return s
Test/Tasty/Golden/Internal.hs view
@@ -6,7 +6,9 @@ import Control.Exception import Data.Typeable (Typeable) import Data.Proxy+import Data.Int import System.IO.Error (isDoesNotExistError)+import Options.Applicative (metavar) import Test.Tasty.Providers import Test.Tasty.Options @@ -42,12 +44,27 @@ optionHelp = return "Error when golden file does not exist" optionCLParser = flagCLParser Nothing (NoCreateFile True) +-- | The size, in bytes, such that the (incorrect) test output is not+-- displayed when it exceeds this size. Numeric underscores are accepted+-- for readability.+--+-- The default value is 1000 (i.e. 1Kb).+newtype SizeCutoff = SizeCutoff Int64+ deriving (Eq, Ord, Typeable, Num, Real, Enum, Integral)+instance IsOption SizeCutoff where+ defaultValue = 1000+ parseValue = fmap SizeCutoff . safeRead . filter (/= '_')+ optionName = return "size-cutoff"+ optionHelp = return "hide golden test output if it's larger than n bytes"+ optionCLParser = mkOptionCLParser $ metavar "n"+ instance IsTest Golden where run opts golden _ = runGolden golden opts testOptions = return [ Option (Proxy :: Proxy AcceptTests) , Option (Proxy :: Proxy NoCreateFile)+ , Option (Proxy :: Proxy SizeCutoff) ] runGolden :: Golden -> OptionSet -> IO Result
+ example/example.hs view
@@ -0,0 +1,41 @@+import Test.Tasty+import Test.Tasty.Golden+import System.FilePath+import qualified Data.ByteString.Lazy.Char8 as LBS++all_numbers, non_square_numbers :: [Int]+all_numbers = [1..1000]+non_square_numbers = filter (\x -> (round . sqrt . fromIntegral) x ^ 2 /= x) all_numbers+all_numbers_str = LBS.pack $ unlines $ map show all_numbers+non_square_numbers_str = LBS.pack $ unlines $ map show non_square_numbers+diff ref new = ["diff", ref, new]++main = defaultMain $ localOption (SizeCutoff 140) $ testGroup "Tests"+ [ testGroup (if success then "Successful tests" else "Failing tests") $+ let+ dir = "example/golden" </> if success then "success" else "fail"+ value = if success then all_numbers_str else non_square_numbers_str+ in+ [ let+ golden = dir </> "goldenVsFile.golden"+ actual = dir </> "goldenVsFile.actual"+ in+ goldenVsFile "goldenVsFile" golden actual+ (createDirectoriesAndWriteFile actual value)+ , let+ golden = dir </> "goldenVsFileDiff.golden"+ actual = dir </> "goldenVsFileDiff.actual"+ in+ goldenVsFileDiff "goldenVsFileDiff" diff golden actual+ (createDirectoriesAndWriteFile actual value)+ , let+ golden = dir </> "goldenVsString.golden"+ in+ goldenVsString "goldenVsString" golden (return value)+ , let+ golden = dir </> "goldenVsStringDiff.golden"+ in+ goldenVsStringDiff "goldenVsStringDiff" diff golden (return value)+ ]+ | success <- [True, False]+ ]
+ example/golden/fail/goldenVsFile.golden view
@@ -0,0 +1,1000 @@+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100+101+102+103+104+105+106+107+108+109+110+111+112+113+114+115+116+117+118+119+120+121+122+123+124+125+126+127+128+129+130+131+132+133+134+135+136+137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153+154+155+156+157+158+159+160+161+162+163+164+165+166+167+168+169+170+171+172+173+174+175+176+177+178+179+180+181+182+183+184+185+186+187+188+189+190+191+192+193+194+195+196+197+198+199+200+201+202+203+204+205+206+207+208+209+210+211+212+213+214+215+216+217+218+219+220+221+222+223+224+225+226+227+228+229+230+231+232+233+234+235+236+237+238+239+240+241+242+243+244+245+246+247+248+249+250+251+252+253+254+255+256+257+258+259+260+261+262+263+264+265+266+267+268+269+270+271+272+273+274+275+276+277+278+279+280+281+282+283+284+285+286+287+288+289+290+291+292+293+294+295+296+297+298+299+300+301+302+303+304+305+306+307+308+309+310+311+312+313+314+315+316+317+318+319+320+321+322+323+324+325+326+327+328+329+330+331+332+333+334+335+336+337+338+339+340+341+342+343+344+345+346+347+348+349+350+351+352+353+354+355+356+357+358+359+360+361+362+363+364+365+366+367+368+369+370+371+372+373+374+375+376+377+378+379+380+381+382+383+384+385+386+387+388+389+390+391+392+393+394+395+396+397+398+399+400+401+402+403+404+405+406+407+408+409+410+411+412+413+414+415+416+417+418+419+420+421+422+423+424+425+426+427+428+429+430+431+432+433+434+435+436+437+438+439+440+441+442+443+444+445+446+447+448+449+450+451+452+453+454+455+456+457+458+459+460+461+462+463+464+465+466+467+468+469+470+471+472+473+474+475+476+477+478+479+480+481+482+483+484+485+486+487+488+489+490+491+492+493+494+495+496+497+498+499+500+501+502+503+504+505+506+507+508+509+510+511+512+513+514+515+516+517+518+519+520+521+522+523+524+525+526+527+528+529+530+531+532+533+534+535+536+537+538+539+540+541+542+543+544+545+546+547+548+549+550+551+552+553+554+555+556+557+558+559+560+561+562+563+564+565+566+567+568+569+570+571+572+573+574+575+576+577+578+579+580+581+582+583+584+585+586+587+588+589+590+591+592+593+594+595+596+597+598+599+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+673+674+675+676+677+678+679+680+681+682+683+684+685+686+687+688+689+690+691+692+693+694+695+696+697+698+699+700+701+702+703+704+705+706+707+708+709+710+711+712+713+714+715+716+717+718+719+720+721+722+723+724+725+726+727+728+729+730+731+732+733+734+735+736+737+738+739+740+741+742+743+744+745+746+747+748+749+750+751+752+753+754+755+756+757+758+759+760+761+762+763+764+765+766+767+768+769+770+771+772+773+774+775+776+777+778+779+780+781+782+783+784+785+786+787+788+789+790+791+792+793+794+795+796+797+798+799+800+801+802+803+804+805+806+807+808+809+810+811+812+813+814+815+816+817+818+819+820+821+822+823+824+825+826+827+828+829+830+831+832+833+834+835+836+837+838+839+840+841+842+843+844+845+846+847+848+849+850+851+852+853+854+855+856+857+858+859+860+861+862+863+864+865+866+867+868+869+870+871+872+873+874+875+876+877+878+879+880+881+882+883+884+885+886+887+888+889+890+891+892+893+894+895+896+897+898+899+900+901+902+903+904+905+906+907+908+909+910+911+912+913+914+915+916+917+918+919+920+921+922+923+924+925+926+927+928+929+930+931+932+933+934+935+936+937+938+939+940+941+942+943+944+945+946+947+948+949+950+951+952+953+954+955+956+957+958+959+960+961+962+963+964+965+966+967+968+969+970+971+972+973+974+975+976+977+978+979+980+981+982+983+984+985+986+987+988+989+990+991+992+993+994+995+996+997+998+999+1000
+ example/golden/fail/goldenVsFileDiff.golden view
@@ -0,0 +1,1000 @@+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100+101+102+103+104+105+106+107+108+109+110+111+112+113+114+115+116+117+118+119+120+121+122+123+124+125+126+127+128+129+130+131+132+133+134+135+136+137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153+154+155+156+157+158+159+160+161+162+163+164+165+166+167+168+169+170+171+172+173+174+175+176+177+178+179+180+181+182+183+184+185+186+187+188+189+190+191+192+193+194+195+196+197+198+199+200+201+202+203+204+205+206+207+208+209+210+211+212+213+214+215+216+217+218+219+220+221+222+223+224+225+226+227+228+229+230+231+232+233+234+235+236+237+238+239+240+241+242+243+244+245+246+247+248+249+250+251+252+253+254+255+256+257+258+259+260+261+262+263+264+265+266+267+268+269+270+271+272+273+274+275+276+277+278+279+280+281+282+283+284+285+286+287+288+289+290+291+292+293+294+295+296+297+298+299+300+301+302+303+304+305+306+307+308+309+310+311+312+313+314+315+316+317+318+319+320+321+322+323+324+325+326+327+328+329+330+331+332+333+334+335+336+337+338+339+340+341+342+343+344+345+346+347+348+349+350+351+352+353+354+355+356+357+358+359+360+361+362+363+364+365+366+367+368+369+370+371+372+373+374+375+376+377+378+379+380+381+382+383+384+385+386+387+388+389+390+391+392+393+394+395+396+397+398+399+400+401+402+403+404+405+406+407+408+409+410+411+412+413+414+415+416+417+418+419+420+421+422+423+424+425+426+427+428+429+430+431+432+433+434+435+436+437+438+439+440+441+442+443+444+445+446+447+448+449+450+451+452+453+454+455+456+457+458+459+460+461+462+463+464+465+466+467+468+469+470+471+472+473+474+475+476+477+478+479+480+481+482+483+484+485+486+487+488+489+490+491+492+493+494+495+496+497+498+499+500+501+502+503+504+505+506+507+508+509+510+511+512+513+514+515+516+517+518+519+520+521+522+523+524+525+526+527+528+529+530+531+532+533+534+535+536+537+538+539+540+541+542+543+544+545+546+547+548+549+550+551+552+553+554+555+556+557+558+559+560+561+562+563+564+565+566+567+568+569+570+571+572+573+574+575+576+577+578+579+580+581+582+583+584+585+586+587+588+589+590+591+592+593+594+595+596+597+598+599+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+673+674+675+676+677+678+679+680+681+682+683+684+685+686+687+688+689+690+691+692+693+694+695+696+697+698+699+700+701+702+703+704+705+706+707+708+709+710+711+712+713+714+715+716+717+718+719+720+721+722+723+724+725+726+727+728+729+730+731+732+733+734+735+736+737+738+739+740+741+742+743+744+745+746+747+748+749+750+751+752+753+754+755+756+757+758+759+760+761+762+763+764+765+766+767+768+769+770+771+772+773+774+775+776+777+778+779+780+781+782+783+784+785+786+787+788+789+790+791+792+793+794+795+796+797+798+799+800+801+802+803+804+805+806+807+808+809+810+811+812+813+814+815+816+817+818+819+820+821+822+823+824+825+826+827+828+829+830+831+832+833+834+835+836+837+838+839+840+841+842+843+844+845+846+847+848+849+850+851+852+853+854+855+856+857+858+859+860+861+862+863+864+865+866+867+868+869+870+871+872+873+874+875+876+877+878+879+880+881+882+883+884+885+886+887+888+889+890+891+892+893+894+895+896+897+898+899+900+901+902+903+904+905+906+907+908+909+910+911+912+913+914+915+916+917+918+919+920+921+922+923+924+925+926+927+928+929+930+931+932+933+934+935+936+937+938+939+940+941+942+943+944+945+946+947+948+949+950+951+952+953+954+955+956+957+958+959+960+961+962+963+964+965+966+967+968+969+970+971+972+973+974+975+976+977+978+979+980+981+982+983+984+985+986+987+988+989+990+991+992+993+994+995+996+997+998+999+1000
+ example/golden/fail/goldenVsString.golden view
@@ -0,0 +1,1000 @@+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100+101+102+103+104+105+106+107+108+109+110+111+112+113+114+115+116+117+118+119+120+121+122+123+124+125+126+127+128+129+130+131+132+133+134+135+136+137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153+154+155+156+157+158+159+160+161+162+163+164+165+166+167+168+169+170+171+172+173+174+175+176+177+178+179+180+181+182+183+184+185+186+187+188+189+190+191+192+193+194+195+196+197+198+199+200+201+202+203+204+205+206+207+208+209+210+211+212+213+214+215+216+217+218+219+220+221+222+223+224+225+226+227+228+229+230+231+232+233+234+235+236+237+238+239+240+241+242+243+244+245+246+247+248+249+250+251+252+253+254+255+256+257+258+259+260+261+262+263+264+265+266+267+268+269+270+271+272+273+274+275+276+277+278+279+280+281+282+283+284+285+286+287+288+289+290+291+292+293+294+295+296+297+298+299+300+301+302+303+304+305+306+307+308+309+310+311+312+313+314+315+316+317+318+319+320+321+322+323+324+325+326+327+328+329+330+331+332+333+334+335+336+337+338+339+340+341+342+343+344+345+346+347+348+349+350+351+352+353+354+355+356+357+358+359+360+361+362+363+364+365+366+367+368+369+370+371+372+373+374+375+376+377+378+379+380+381+382+383+384+385+386+387+388+389+390+391+392+393+394+395+396+397+398+399+400+401+402+403+404+405+406+407+408+409+410+411+412+413+414+415+416+417+418+419+420+421+422+423+424+425+426+427+428+429+430+431+432+433+434+435+436+437+438+439+440+441+442+443+444+445+446+447+448+449+450+451+452+453+454+455+456+457+458+459+460+461+462+463+464+465+466+467+468+469+470+471+472+473+474+475+476+477+478+479+480+481+482+483+484+485+486+487+488+489+490+491+492+493+494+495+496+497+498+499+500+501+502+503+504+505+506+507+508+509+510+511+512+513+514+515+516+517+518+519+520+521+522+523+524+525+526+527+528+529+530+531+532+533+534+535+536+537+538+539+540+541+542+543+544+545+546+547+548+549+550+551+552+553+554+555+556+557+558+559+560+561+562+563+564+565+566+567+568+569+570+571+572+573+574+575+576+577+578+579+580+581+582+583+584+585+586+587+588+589+590+591+592+593+594+595+596+597+598+599+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+673+674+675+676+677+678+679+680+681+682+683+684+685+686+687+688+689+690+691+692+693+694+695+696+697+698+699+700+701+702+703+704+705+706+707+708+709+710+711+712+713+714+715+716+717+718+719+720+721+722+723+724+725+726+727+728+729+730+731+732+733+734+735+736+737+738+739+740+741+742+743+744+745+746+747+748+749+750+751+752+753+754+755+756+757+758+759+760+761+762+763+764+765+766+767+768+769+770+771+772+773+774+775+776+777+778+779+780+781+782+783+784+785+786+787+788+789+790+791+792+793+794+795+796+797+798+799+800+801+802+803+804+805+806+807+808+809+810+811+812+813+814+815+816+817+818+819+820+821+822+823+824+825+826+827+828+829+830+831+832+833+834+835+836+837+838+839+840+841+842+843+844+845+846+847+848+849+850+851+852+853+854+855+856+857+858+859+860+861+862+863+864+865+866+867+868+869+870+871+872+873+874+875+876+877+878+879+880+881+882+883+884+885+886+887+888+889+890+891+892+893+894+895+896+897+898+899+900+901+902+903+904+905+906+907+908+909+910+911+912+913+914+915+916+917+918+919+920+921+922+923+924+925+926+927+928+929+930+931+932+933+934+935+936+937+938+939+940+941+942+943+944+945+946+947+948+949+950+951+952+953+954+955+956+957+958+959+960+961+962+963+964+965+966+967+968+969+970+971+972+973+974+975+976+977+978+979+980+981+982+983+984+985+986+987+988+989+990+991+992+993+994+995+996+997+998+999+1000
+ example/golden/fail/goldenVsStringDiff.golden view
@@ -0,0 +1,1000 @@+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100+101+102+103+104+105+106+107+108+109+110+111+112+113+114+115+116+117+118+119+120+121+122+123+124+125+126+127+128+129+130+131+132+133+134+135+136+137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153+154+155+156+157+158+159+160+161+162+163+164+165+166+167+168+169+170+171+172+173+174+175+176+177+178+179+180+181+182+183+184+185+186+187+188+189+190+191+192+193+194+195+196+197+198+199+200+201+202+203+204+205+206+207+208+209+210+211+212+213+214+215+216+217+218+219+220+221+222+223+224+225+226+227+228+229+230+231+232+233+234+235+236+237+238+239+240+241+242+243+244+245+246+247+248+249+250+251+252+253+254+255+256+257+258+259+260+261+262+263+264+265+266+267+268+269+270+271+272+273+274+275+276+277+278+279+280+281+282+283+284+285+286+287+288+289+290+291+292+293+294+295+296+297+298+299+300+301+302+303+304+305+306+307+308+309+310+311+312+313+314+315+316+317+318+319+320+321+322+323+324+325+326+327+328+329+330+331+332+333+334+335+336+337+338+339+340+341+342+343+344+345+346+347+348+349+350+351+352+353+354+355+356+357+358+359+360+361+362+363+364+365+366+367+368+369+370+371+372+373+374+375+376+377+378+379+380+381+382+383+384+385+386+387+388+389+390+391+392+393+394+395+396+397+398+399+400+401+402+403+404+405+406+407+408+409+410+411+412+413+414+415+416+417+418+419+420+421+422+423+424+425+426+427+428+429+430+431+432+433+434+435+436+437+438+439+440+441+442+443+444+445+446+447+448+449+450+451+452+453+454+455+456+457+458+459+460+461+462+463+464+465+466+467+468+469+470+471+472+473+474+475+476+477+478+479+480+481+482+483+484+485+486+487+488+489+490+491+492+493+494+495+496+497+498+499+500+501+502+503+504+505+506+507+508+509+510+511+512+513+514+515+516+517+518+519+520+521+522+523+524+525+526+527+528+529+530+531+532+533+534+535+536+537+538+539+540+541+542+543+544+545+546+547+548+549+550+551+552+553+554+555+556+557+558+559+560+561+562+563+564+565+566+567+568+569+570+571+572+573+574+575+576+577+578+579+580+581+582+583+584+585+586+587+588+589+590+591+592+593+594+595+596+597+598+599+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+673+674+675+676+677+678+679+680+681+682+683+684+685+686+687+688+689+690+691+692+693+694+695+696+697+698+699+700+701+702+703+704+705+706+707+708+709+710+711+712+713+714+715+716+717+718+719+720+721+722+723+724+725+726+727+728+729+730+731+732+733+734+735+736+737+738+739+740+741+742+743+744+745+746+747+748+749+750+751+752+753+754+755+756+757+758+759+760+761+762+763+764+765+766+767+768+769+770+771+772+773+774+775+776+777+778+779+780+781+782+783+784+785+786+787+788+789+790+791+792+793+794+795+796+797+798+799+800+801+802+803+804+805+806+807+808+809+810+811+812+813+814+815+816+817+818+819+820+821+822+823+824+825+826+827+828+829+830+831+832+833+834+835+836+837+838+839+840+841+842+843+844+845+846+847+848+849+850+851+852+853+854+855+856+857+858+859+860+861+862+863+864+865+866+867+868+869+870+871+872+873+874+875+876+877+878+879+880+881+882+883+884+885+886+887+888+889+890+891+892+893+894+895+896+897+898+899+900+901+902+903+904+905+906+907+908+909+910+911+912+913+914+915+916+917+918+919+920+921+922+923+924+925+926+927+928+929+930+931+932+933+934+935+936+937+938+939+940+941+942+943+944+945+946+947+948+949+950+951+952+953+954+955+956+957+958+959+960+961+962+963+964+965+966+967+968+969+970+971+972+973+974+975+976+977+978+979+980+981+982+983+984+985+986+987+988+989+990+991+992+993+994+995+996+997+998+999+1000
+ example/golden/success/goldenVsFile.golden view
@@ -0,0 +1,1000 @@+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100+101+102+103+104+105+106+107+108+109+110+111+112+113+114+115+116+117+118+119+120+121+122+123+124+125+126+127+128+129+130+131+132+133+134+135+136+137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153+154+155+156+157+158+159+160+161+162+163+164+165+166+167+168+169+170+171+172+173+174+175+176+177+178+179+180+181+182+183+184+185+186+187+188+189+190+191+192+193+194+195+196+197+198+199+200+201+202+203+204+205+206+207+208+209+210+211+212+213+214+215+216+217+218+219+220+221+222+223+224+225+226+227+228+229+230+231+232+233+234+235+236+237+238+239+240+241+242+243+244+245+246+247+248+249+250+251+252+253+254+255+256+257+258+259+260+261+262+263+264+265+266+267+268+269+270+271+272+273+274+275+276+277+278+279+280+281+282+283+284+285+286+287+288+289+290+291+292+293+294+295+296+297+298+299+300+301+302+303+304+305+306+307+308+309+310+311+312+313+314+315+316+317+318+319+320+321+322+323+324+325+326+327+328+329+330+331+332+333+334+335+336+337+338+339+340+341+342+343+344+345+346+347+348+349+350+351+352+353+354+355+356+357+358+359+360+361+362+363+364+365+366+367+368+369+370+371+372+373+374+375+376+377+378+379+380+381+382+383+384+385+386+387+388+389+390+391+392+393+394+395+396+397+398+399+400+401+402+403+404+405+406+407+408+409+410+411+412+413+414+415+416+417+418+419+420+421+422+423+424+425+426+427+428+429+430+431+432+433+434+435+436+437+438+439+440+441+442+443+444+445+446+447+448+449+450+451+452+453+454+455+456+457+458+459+460+461+462+463+464+465+466+467+468+469+470+471+472+473+474+475+476+477+478+479+480+481+482+483+484+485+486+487+488+489+490+491+492+493+494+495+496+497+498+499+500+501+502+503+504+505+506+507+508+509+510+511+512+513+514+515+516+517+518+519+520+521+522+523+524+525+526+527+528+529+530+531+532+533+534+535+536+537+538+539+540+541+542+543+544+545+546+547+548+549+550+551+552+553+554+555+556+557+558+559+560+561+562+563+564+565+566+567+568+569+570+571+572+573+574+575+576+577+578+579+580+581+582+583+584+585+586+587+588+589+590+591+592+593+594+595+596+597+598+599+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+673+674+675+676+677+678+679+680+681+682+683+684+685+686+687+688+689+690+691+692+693+694+695+696+697+698+699+700+701+702+703+704+705+706+707+708+709+710+711+712+713+714+715+716+717+718+719+720+721+722+723+724+725+726+727+728+729+730+731+732+733+734+735+736+737+738+739+740+741+742+743+744+745+746+747+748+749+750+751+752+753+754+755+756+757+758+759+760+761+762+763+764+765+766+767+768+769+770+771+772+773+774+775+776+777+778+779+780+781+782+783+784+785+786+787+788+789+790+791+792+793+794+795+796+797+798+799+800+801+802+803+804+805+806+807+808+809+810+811+812+813+814+815+816+817+818+819+820+821+822+823+824+825+826+827+828+829+830+831+832+833+834+835+836+837+838+839+840+841+842+843+844+845+846+847+848+849+850+851+852+853+854+855+856+857+858+859+860+861+862+863+864+865+866+867+868+869+870+871+872+873+874+875+876+877+878+879+880+881+882+883+884+885+886+887+888+889+890+891+892+893+894+895+896+897+898+899+900+901+902+903+904+905+906+907+908+909+910+911+912+913+914+915+916+917+918+919+920+921+922+923+924+925+926+927+928+929+930+931+932+933+934+935+936+937+938+939+940+941+942+943+944+945+946+947+948+949+950+951+952+953+954+955+956+957+958+959+960+961+962+963+964+965+966+967+968+969+970+971+972+973+974+975+976+977+978+979+980+981+982+983+984+985+986+987+988+989+990+991+992+993+994+995+996+997+998+999+1000
+ example/golden/success/goldenVsFileDiff.golden view
@@ -0,0 +1,1000 @@+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100+101+102+103+104+105+106+107+108+109+110+111+112+113+114+115+116+117+118+119+120+121+122+123+124+125+126+127+128+129+130+131+132+133+134+135+136+137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153+154+155+156+157+158+159+160+161+162+163+164+165+166+167+168+169+170+171+172+173+174+175+176+177+178+179+180+181+182+183+184+185+186+187+188+189+190+191+192+193+194+195+196+197+198+199+200+201+202+203+204+205+206+207+208+209+210+211+212+213+214+215+216+217+218+219+220+221+222+223+224+225+226+227+228+229+230+231+232+233+234+235+236+237+238+239+240+241+242+243+244+245+246+247+248+249+250+251+252+253+254+255+256+257+258+259+260+261+262+263+264+265+266+267+268+269+270+271+272+273+274+275+276+277+278+279+280+281+282+283+284+285+286+287+288+289+290+291+292+293+294+295+296+297+298+299+300+301+302+303+304+305+306+307+308+309+310+311+312+313+314+315+316+317+318+319+320+321+322+323+324+325+326+327+328+329+330+331+332+333+334+335+336+337+338+339+340+341+342+343+344+345+346+347+348+349+350+351+352+353+354+355+356+357+358+359+360+361+362+363+364+365+366+367+368+369+370+371+372+373+374+375+376+377+378+379+380+381+382+383+384+385+386+387+388+389+390+391+392+393+394+395+396+397+398+399+400+401+402+403+404+405+406+407+408+409+410+411+412+413+414+415+416+417+418+419+420+421+422+423+424+425+426+427+428+429+430+431+432+433+434+435+436+437+438+439+440+441+442+443+444+445+446+447+448+449+450+451+452+453+454+455+456+457+458+459+460+461+462+463+464+465+466+467+468+469+470+471+472+473+474+475+476+477+478+479+480+481+482+483+484+485+486+487+488+489+490+491+492+493+494+495+496+497+498+499+500+501+502+503+504+505+506+507+508+509+510+511+512+513+514+515+516+517+518+519+520+521+522+523+524+525+526+527+528+529+530+531+532+533+534+535+536+537+538+539+540+541+542+543+544+545+546+547+548+549+550+551+552+553+554+555+556+557+558+559+560+561+562+563+564+565+566+567+568+569+570+571+572+573+574+575+576+577+578+579+580+581+582+583+584+585+586+587+588+589+590+591+592+593+594+595+596+597+598+599+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+673+674+675+676+677+678+679+680+681+682+683+684+685+686+687+688+689+690+691+692+693+694+695+696+697+698+699+700+701+702+703+704+705+706+707+708+709+710+711+712+713+714+715+716+717+718+719+720+721+722+723+724+725+726+727+728+729+730+731+732+733+734+735+736+737+738+739+740+741+742+743+744+745+746+747+748+749+750+751+752+753+754+755+756+757+758+759+760+761+762+763+764+765+766+767+768+769+770+771+772+773+774+775+776+777+778+779+780+781+782+783+784+785+786+787+788+789+790+791+792+793+794+795+796+797+798+799+800+801+802+803+804+805+806+807+808+809+810+811+812+813+814+815+816+817+818+819+820+821+822+823+824+825+826+827+828+829+830+831+832+833+834+835+836+837+838+839+840+841+842+843+844+845+846+847+848+849+850+851+852+853+854+855+856+857+858+859+860+861+862+863+864+865+866+867+868+869+870+871+872+873+874+875+876+877+878+879+880+881+882+883+884+885+886+887+888+889+890+891+892+893+894+895+896+897+898+899+900+901+902+903+904+905+906+907+908+909+910+911+912+913+914+915+916+917+918+919+920+921+922+923+924+925+926+927+928+929+930+931+932+933+934+935+936+937+938+939+940+941+942+943+944+945+946+947+948+949+950+951+952+953+954+955+956+957+958+959+960+961+962+963+964+965+966+967+968+969+970+971+972+973+974+975+976+977+978+979+980+981+982+983+984+985+986+987+988+989+990+991+992+993+994+995+996+997+998+999+1000
+ example/golden/success/goldenVsString.golden view
@@ -0,0 +1,1000 @@+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100+101+102+103+104+105+106+107+108+109+110+111+112+113+114+115+116+117+118+119+120+121+122+123+124+125+126+127+128+129+130+131+132+133+134+135+136+137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153+154+155+156+157+158+159+160+161+162+163+164+165+166+167+168+169+170+171+172+173+174+175+176+177+178+179+180+181+182+183+184+185+186+187+188+189+190+191+192+193+194+195+196+197+198+199+200+201+202+203+204+205+206+207+208+209+210+211+212+213+214+215+216+217+218+219+220+221+222+223+224+225+226+227+228+229+230+231+232+233+234+235+236+237+238+239+240+241+242+243+244+245+246+247+248+249+250+251+252+253+254+255+256+257+258+259+260+261+262+263+264+265+266+267+268+269+270+271+272+273+274+275+276+277+278+279+280+281+282+283+284+285+286+287+288+289+290+291+292+293+294+295+296+297+298+299+300+301+302+303+304+305+306+307+308+309+310+311+312+313+314+315+316+317+318+319+320+321+322+323+324+325+326+327+328+329+330+331+332+333+334+335+336+337+338+339+340+341+342+343+344+345+346+347+348+349+350+351+352+353+354+355+356+357+358+359+360+361+362+363+364+365+366+367+368+369+370+371+372+373+374+375+376+377+378+379+380+381+382+383+384+385+386+387+388+389+390+391+392+393+394+395+396+397+398+399+400+401+402+403+404+405+406+407+408+409+410+411+412+413+414+415+416+417+418+419+420+421+422+423+424+425+426+427+428+429+430+431+432+433+434+435+436+437+438+439+440+441+442+443+444+445+446+447+448+449+450+451+452+453+454+455+456+457+458+459+460+461+462+463+464+465+466+467+468+469+470+471+472+473+474+475+476+477+478+479+480+481+482+483+484+485+486+487+488+489+490+491+492+493+494+495+496+497+498+499+500+501+502+503+504+505+506+507+508+509+510+511+512+513+514+515+516+517+518+519+520+521+522+523+524+525+526+527+528+529+530+531+532+533+534+535+536+537+538+539+540+541+542+543+544+545+546+547+548+549+550+551+552+553+554+555+556+557+558+559+560+561+562+563+564+565+566+567+568+569+570+571+572+573+574+575+576+577+578+579+580+581+582+583+584+585+586+587+588+589+590+591+592+593+594+595+596+597+598+599+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+673+674+675+676+677+678+679+680+681+682+683+684+685+686+687+688+689+690+691+692+693+694+695+696+697+698+699+700+701+702+703+704+705+706+707+708+709+710+711+712+713+714+715+716+717+718+719+720+721+722+723+724+725+726+727+728+729+730+731+732+733+734+735+736+737+738+739+740+741+742+743+744+745+746+747+748+749+750+751+752+753+754+755+756+757+758+759+760+761+762+763+764+765+766+767+768+769+770+771+772+773+774+775+776+777+778+779+780+781+782+783+784+785+786+787+788+789+790+791+792+793+794+795+796+797+798+799+800+801+802+803+804+805+806+807+808+809+810+811+812+813+814+815+816+817+818+819+820+821+822+823+824+825+826+827+828+829+830+831+832+833+834+835+836+837+838+839+840+841+842+843+844+845+846+847+848+849+850+851+852+853+854+855+856+857+858+859+860+861+862+863+864+865+866+867+868+869+870+871+872+873+874+875+876+877+878+879+880+881+882+883+884+885+886+887+888+889+890+891+892+893+894+895+896+897+898+899+900+901+902+903+904+905+906+907+908+909+910+911+912+913+914+915+916+917+918+919+920+921+922+923+924+925+926+927+928+929+930+931+932+933+934+935+936+937+938+939+940+941+942+943+944+945+946+947+948+949+950+951+952+953+954+955+956+957+958+959+960+961+962+963+964+965+966+967+968+969+970+971+972+973+974+975+976+977+978+979+980+981+982+983+984+985+986+987+988+989+990+991+992+993+994+995+996+997+998+999+1000
+ example/golden/success/goldenVsStringDiff.golden view
@@ -0,0 +1,1000 @@+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100+101+102+103+104+105+106+107+108+109+110+111+112+113+114+115+116+117+118+119+120+121+122+123+124+125+126+127+128+129+130+131+132+133+134+135+136+137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153+154+155+156+157+158+159+160+161+162+163+164+165+166+167+168+169+170+171+172+173+174+175+176+177+178+179+180+181+182+183+184+185+186+187+188+189+190+191+192+193+194+195+196+197+198+199+200+201+202+203+204+205+206+207+208+209+210+211+212+213+214+215+216+217+218+219+220+221+222+223+224+225+226+227+228+229+230+231+232+233+234+235+236+237+238+239+240+241+242+243+244+245+246+247+248+249+250+251+252+253+254+255+256+257+258+259+260+261+262+263+264+265+266+267+268+269+270+271+272+273+274+275+276+277+278+279+280+281+282+283+284+285+286+287+288+289+290+291+292+293+294+295+296+297+298+299+300+301+302+303+304+305+306+307+308+309+310+311+312+313+314+315+316+317+318+319+320+321+322+323+324+325+326+327+328+329+330+331+332+333+334+335+336+337+338+339+340+341+342+343+344+345+346+347+348+349+350+351+352+353+354+355+356+357+358+359+360+361+362+363+364+365+366+367+368+369+370+371+372+373+374+375+376+377+378+379+380+381+382+383+384+385+386+387+388+389+390+391+392+393+394+395+396+397+398+399+400+401+402+403+404+405+406+407+408+409+410+411+412+413+414+415+416+417+418+419+420+421+422+423+424+425+426+427+428+429+430+431+432+433+434+435+436+437+438+439+440+441+442+443+444+445+446+447+448+449+450+451+452+453+454+455+456+457+458+459+460+461+462+463+464+465+466+467+468+469+470+471+472+473+474+475+476+477+478+479+480+481+482+483+484+485+486+487+488+489+490+491+492+493+494+495+496+497+498+499+500+501+502+503+504+505+506+507+508+509+510+511+512+513+514+515+516+517+518+519+520+521+522+523+524+525+526+527+528+529+530+531+532+533+534+535+536+537+538+539+540+541+542+543+544+545+546+547+548+549+550+551+552+553+554+555+556+557+558+559+560+561+562+563+564+565+566+567+568+569+570+571+572+573+574+575+576+577+578+579+580+581+582+583+584+585+586+587+588+589+590+591+592+593+594+595+596+597+598+599+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+673+674+675+676+677+678+679+680+681+682+683+684+685+686+687+688+689+690+691+692+693+694+695+696+697+698+699+700+701+702+703+704+705+706+707+708+709+710+711+712+713+714+715+716+717+718+719+720+721+722+723+724+725+726+727+728+729+730+731+732+733+734+735+736+737+738+739+740+741+742+743+744+745+746+747+748+749+750+751+752+753+754+755+756+757+758+759+760+761+762+763+764+765+766+767+768+769+770+771+772+773+774+775+776+777+778+779+780+781+782+783+784+785+786+787+788+789+790+791+792+793+794+795+796+797+798+799+800+801+802+803+804+805+806+807+808+809+810+811+812+813+814+815+816+817+818+819+820+821+822+823+824+825+826+827+828+829+830+831+832+833+834+835+836+837+838+839+840+841+842+843+844+845+846+847+848+849+850+851+852+853+854+855+856+857+858+859+860+861+862+863+864+865+866+867+868+869+870+871+872+873+874+875+876+877+878+879+880+881+882+883+884+885+886+887+888+889+890+891+892+893+894+895+896+897+898+899+900+901+902+903+904+905+906+907+908+909+910+911+912+913+914+915+916+917+918+919+920+921+922+923+924+925+926+927+928+929+930+931+932+933+934+935+936+937+938+939+940+941+942+943+944+945+946+947+948+949+950+951+952+953+954+955+956+957+958+959+960+961+962+963+964+965+966+967+968+969+970+971+972+973+974+975+976+977+978+979+980+981+982+983+984+985+986+987+988+989+990+991+992+993+994+995+996+997+998+999+1000
tasty-golden.cabal view
@@ -1,5 +1,5 @@ name: tasty-golden-version: 2.3.2.1+version: 2.3.3 synopsis: Golden tests support for tasty description: This package provides support for «golden testing».@@ -21,9 +21,15 @@ category: Testing build-type: Simple cabal-version: >=1.14-extra-source-files: CHANGELOG.md+extra-source-files:+ CHANGELOG.md+ example/golden/fail/*.golden+ example/golden/success/*.golden+ tests/golden/*.golden Tested-With:- GHC ==8.0.2 ||+ GHC ==7.8.4 ||+ ==7.10.3 ||+ ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 ||@@ -45,7 +51,7 @@ ghc-options: -Wall build-depends:- base ==4.*,+ base >= 4.7, tasty >= 1.0.1, bytestring >= 0.9.2.1, process,@@ -70,10 +76,37 @@ test.hs Build-depends: base >= 4 && < 5- , tasty+ , tasty >= 1.2 , tasty-hunit , tasty-golden , filepath , directory , process- , temporary-rc+ , temporary+ if (flag(build-example))+ cpp-options: -DBUILD_EXAMPLE++flag build-example+ default: False+ manual: True++-- An example test suite used for testing.+-- Tries to exercise all ways to create golden tests.+-- Not built by default. To build it, turn on the build-example flag:+--+-- stack build :example --flag tasty-golden:build-example+executable example+ Default-language:+ Haskell2010+ Hs-source-dirs:+ example+ Main-is:+ example.hs+ if (! flag(build-example))+ buildable: False+ Build-depends:+ base >= 4 && < 5+ , filepath+ , bytestring+ , tasty+ , tasty-golden
+ tests/golden/after-accept.golden view
@@ -0,0 +1,13 @@+Tests+ Successful tests+ goldenVsFile: OK+ goldenVsFileDiff: OK+ goldenVsString: OK+ goldenVsStringDiff: OK+ Failing tests+ goldenVsFile: OK+ goldenVsFileDiff: OK+ goldenVsString: OK+ goldenVsStringDiff: OK++All 8 tests passed
+ tests/golden/before-accept.golden view
@@ -0,0 +1,120 @@+Tests+ Successful tests+ goldenVsFile: OK+ goldenVsFileDiff: OK+ goldenVsString: OK+ goldenVsStringDiff: OK+ Failing tests+ goldenVsFile: FAIL+ Files 'example/golden/fail/goldenVsFile.golden' and 'example/golden/fail/goldenVsFile.actual' differ+ goldenVsFileDiff: FAIL+ 1d0+ < 1+ 4d2+ < 4+ 9d6+ < 9+ 16d12+ < 16+ 25d20+ < 25+ 36d30+ < 36+ 49d42+ < 49+ 64d56+ < 64+ 81d72+ < 81+ 100d90+ < 100+ 121d110+ < 121+ 144d132+ < 144+ 169d156+ <<truncated>+ Use --accept or increase --size-cutoff to see full output.+ goldenVsString: FAIL+ Test output was different from 'example/golden/fail/goldenVsString.golden'. It was:+ 2+ 3+ 5+ 6+ 7+ 8+ 10+ 11+ 12+ 13+ 14+ 15+ 17+ 18+ 19+ 20+ 21+ 22+ 23+ 24+ 26+ 27+ 28+ 29+ 30+ 31+ 32+ 33+ 34+ 35+ 37+ 38+ 39+ 40+ 41+ 42+ 43+ 44+ 45+ 46+ 47+ 48+ 50+ 51+ 52+ 53+ 54+ 55+ 56<truncated>+ Use --accept or increase --size-cutoff to see full output.+ goldenVsStringDiff: FAIL+ Test output was different from 'example/golden/fail/goldenVsStringDiff.golden'. Output of ["diff","example/golden/fail/goldenVsStringDiff.golden","/tmp/goldenVsStringDiff.actual"]:+ 1d0+ < 1+ 4d2+ < 4+ 9d6+ < 9+ 16d12+ < 16+ 25d20+ < 25+ 36d30+ < 36+ 49d42+ < 49+ 64d56+ < 64+ 81d72+ < 81+ 100d90+ < 100+ 121d110+ < 121+ 144d132+ < 144+ 169d156+ <<truncated>+ Use --accept or increase --size-cutoff to see full output.++4 out of 8 tests failed
+ tests/golden/with-accept.golden view
@@ -0,0 +1,17 @@+Tests+ Successful tests+ goldenVsFile: OK+ goldenVsFileDiff: OK+ goldenVsString: OK+ goldenVsStringDiff: OK+ Failing tests+ goldenVsFile: OK+ Accepted the new version+ goldenVsFileDiff: OK+ Accepted the new version+ goldenVsString: OK+ Accepted the new version+ goldenVsStringDiff: OK+ Accepted the new version++All 8 tests passed
tests/test.hs view
@@ -1,29 +1,80 @@+{-# LANGUAGE CPP #-} import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.Golden import System.IO.Temp import System.FilePath import System.Directory+import System.Process import Data.List (sort) touch f = writeFile f ""+diff ref new = ["diff", "-u", ref, new] -main = defaultMain $- testCase "findByExtension" $+main = defaultMain $ testGroup "Tests"+ [ testCase "findByExtension" $ withSystemTempDirectory "golden-test" $ \basedir -> do - setCurrentDirectory basedir-- createDirectory ("d1")- createDirectory ("d1" </> "d2")- touch ("f1.c")- touch ("f2.h")- touch ("f2.exe")- touch ("d1" </> "g1.c")- touch ("d1" </> "d2" </> "h1.c")- touch ("d1" </> "d2" </> "h1.exe")- touch ("d1" </> "d2" </> "h1")+ createDirectory (basedir </> "d1")+ createDirectory (basedir </> "d1" </> "d2")+ touch (basedir </> "f1.c")+ touch (basedir </> "f2.h")+ touch (basedir </> "f2.exe")+ touch (basedir </> "d1" </> "g1.c")+ touch (basedir </> "d1" </> "d2" </> "h1.c")+ touch (basedir </> "d1" </> "d2" </> "h1.exe")+ touch (basedir </> "d1" </> "d2" </> "h1") - files <- findByExtension [".c", ".h"] "."- sort files @?= sort- ["./d1/d2/h1.c","./d1/g1.c","./f1.c","./f2.h"]+ files <- findByExtension [".c", ".h"] basedir+ sort files @?= (sort . map (basedir </>))+ ["d1/d2/h1.c","d1/g1.c","f1.c","f2.h"]+#ifdef BUILD_EXAMPLE+ , withResource+ (do+ tmp0 <- getCanonicalTemporaryDirectory+ tmp <- createTempDirectory tmp0 "golden-test"+ callProcess "cp" ["-r", "example", tmp]+ return tmp+ )+ ({-removeDirectoryRecursive-}const $ return ()) $ \tmpIO ->+ testGroup "Example test suite"+ [ goldenVsFileDiff+ "before --accept"+ diff+ "tests/golden/before-accept.golden"+ "tests/golden/before-accept.actual"+ (do+ tmp <- tmpIO+ our <- getCurrentDirectory+ -- The sed invocation is used to get rid of the differences+ -- caused by random file names in goldenVsStringDiff and by the+ -- timings.+ --+ -- NB: cannot use multiline literals because of CPP.+ callCommand ("cd " ++ tmp ++ " && example | " +++ "sed -Ee 's/[[:digit:]-]+\\.actual/.actual/g; s/ \\([[:digit:].]+s\\)//' > " +++ our</>"tests/golden/before-accept.actual || true")+ )+ , after AllFinish "/before --accept/" $ goldenVsFileDiff+ "with --accept"+ diff+ "tests/golden/with-accept.golden"+ "tests/golden/with-accept.actual"+ (do+ tmp <- tmpIO+ our <- getCurrentDirectory+ callCommand ("cd " ++ tmp ++ " && example --accept | sed -Ee 's/ \\([[:digit:].]+s\\)//' > " ++ our </>"tests/golden/with-accept.actual")+ )+ , after AllFinish "/with --accept/" $ goldenVsFileDiff+ "after --accept"+ diff+ "tests/golden/after-accept.golden"+ "tests/golden/after-accept.actual"+ (do+ tmp <- tmpIO+ our <- getCurrentDirectory+ callCommand ("cd " ++ tmp ++ " && example | sed -Ee 's/ \\([[:digit:].]+s\\)//' > " ++ our</>"tests/golden/after-accept.actual")+ )+ ]+#endif+ ]