shower 0.2 → 0.2.0.1
raw patch · 26 files changed
+243/−9 lines, 26 files
Files
- shower.cabal +5/−1
- tests/Main.hs +12/−8
- tests/in-out/Basic.in +1/−0
- tests/in-out/Basic.out +7/−0
- tests/in-out/Commas.in +1/−0
- tests/in-out/Commas.out +1/−0
- tests/in-out/JSON.in +84/−0
- tests/in-out/JSON.out +92/−0
- tests/in-out/Lists.in +1/−0
- tests/in-out/Lists.out +3/−0
- tests/in-out/Literals.in +7/−0
- tests/in-out/Literals.out +8/−0
- tests/in-out/Misc.in +2/−0
- tests/in-out/Misc.out +2/−0
- tests/in-out/Suboptimal.in +1/−0
- tests/in-out/Suboptimal.out +1/−0
- tests/in-out/Time.in +1/−0
- tests/in-out/Time.out +1/−0
- tests/in-out/Tuples.in +1/−0
- tests/in-out/Tuples.out +3/−0
- tests/in-out/TypeReps.in +1/−0
- tests/in-out/TypeReps.out +1/−0
- tests/in-out/UUIDs.in +2/−0
- tests/in-out/UUIDs.out +2/−0
- tests/in-out/Units.in +2/−0
- tests/in-out/Units.out +1/−0
shower.cabal view
@@ -1,5 +1,5 @@ name: shower-version: 0.2+version: 0.2.0.1 synopsis: Clean up the formatting of 'show' output -- description: license: BSD3@@ -12,6 +12,10 @@ homepage: https://monadfix.io/shower bug-reports: http://github.com/monadfix/shower/issues++extra-source-files:+ tests/in-out/*.in+ tests/in-out/*.out source-repository head type: git
tests/Main.hs view
@@ -104,7 +104,8 @@ ".out" -> go (accBadExt, accInExt, (name, p) : accOutExt) ps _ -> go (p:accBadExt, accInExt, accOutExt) ps --- | Output differences between a file and a string using @git diff@.+-- | Output differences between a file and a string. Uses @git diff@ to show+-- the differences. diffTest :: TestName -> FilePath -- ^ Expected ".out" file@@ -115,10 +116,13 @@ where template = takeFileName ref <.> "actual" diffParams = ["--no-index", "--color", "--word-diff-regex=."]- cmp _ actual = withSystemTempFile template $ \tmpFile tmpHandle -> do- hPutStr tmpHandle actual >> hFlush tmpHandle- let diffProc = proc "git" (["diff"] ++ diffParams ++ [ref, tmpFile])- (exitCode, out, _) <- readCreateProcessWithExitCode diffProc ""- return $ case exitCode of- ExitSuccess -> Nothing- _ -> Just (unlines . drop 4 . lines $ out) -- drop diff header+ cmp expected actual = withSystemTempFile template $ \tmpFile tmpHandle -> do+ if expected == actual+ then return Nothing+ else do+ hPutStr tmpHandle actual >> hFlush tmpHandle+ let diffProc = proc "git" (["diff"] ++ diffParams ++ [ref, tmpFile])+ (exitCode, out, _) <- readCreateProcessWithExitCode diffProc ""+ return $ case exitCode of+ ExitSuccess -> Nothing+ _ -> Just (unlines . drop 4 . lines $ out) -- drop diff header
+ tests/in-out/Basic.in view
@@ -0,0 +1,1 @@+([(akkarbaghar, 19192381832183182399), (blurgh buzz karraghastazd, fnfnnnffnfn gghoooggogoooh xxzzxxzxxzxzxzx { key = 7, 999666 = (kktkt tktktk) })], 12118818128ksksssk)
+ tests/in-out/Basic.out view
@@ -0,0 +1,7 @@+([(akkarbaghar, 19192381832183182399),+ (blurgh buzz karraghastazd,+ fnfnnnffnfn+ gghoooggogoooh+ xxzzxxzxxzxzxzx+ {key = 7, 999666 = (kktkt tktktk)})],+ 12118818128ksksssk)
+ tests/in-out/Commas.in view
@@ -0,0 +1,1 @@+[, , hello, world,,, of commas]
+ tests/in-out/Commas.out view
@@ -0,0 +1,1 @@+[, , hello, world, , , of commas]
+ tests/in-out/JSON.in view
@@ -0,0 +1,84 @@+{"web-app": {"servlet": [{+"servlet-name": "cofaxCDS",+"servlet-class": "org.cofax.cds.CDSServlet",+"init-param": {+"configGlossary:installationAt": "Philadelphia, PA",+"configGlossary:adminEmail": "ksm@pobox.com",+"configGlossary:poweredBy": "Cofax",+"configGlossary:poweredByIcon": "/images/cofax.gif",+"configGlossary:staticPath": "/content/static",+"templateProcessorClass": "org.cofax.WysiwygTemplate",+"templateLoaderClass": "org.cofax.FilesTemplateLoader",+"templatePath": "templates",+"templateOverridePath": "",+"defaultListTemplate": "listTemplate.htm",+"defaultFileTemplate": "articleTemplate.htm",+"useJSP": false,+"jspListTemplate": "listTemplate.jsp",+"jspFileTemplate": "articleTemplate.jsp",+"cachePackageTagsTrack": 200,+"cachePackageTagsStore": 200,+"cachePackageTagsRefresh": 60,+"cacheTemplatesTrack": 100,+"cacheTemplatesStore": 50,+"cacheTemplatesRefresh": 15,+"cachePagesTrack": 200,+"cachePagesStore": 100,+"cachePagesRefresh": 10,+"cachePagesDirtyRead": 10,+"searchEngineListTemplate": "forSearchEnginesList.htm",+"searchEngineFileTemplate": "forSearchEngines.htm",+"searchEngineRobotsDb": "WEB-INF/robots.db",+"useDataStore": true,+"dataStoreClass": "org.cofax.SqlDataStore",+"redirectionClass": "org.cofax.SqlRedirection",+"dataStoreName": "cofax",+"dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",+"dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",+"dataStoreUser": "sa",+"dataStorePassword": "dataStoreTestQuery",+"dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",+"dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",+"dataStoreInitConns": 10,+"dataStoreMaxConns": 100,+"dataStoreConnUsageLimit": 100,+"dataStoreLogLevel": "debug",+"maxUrlLength": 500}},+{+"servlet-name": "cofaxEmail",+"servlet-class": "org.cofax.cds.EmailServlet",+"init-param": {+"mailHost": "mail1",+"mailHostOverride": "mail2"}},+{+"servlet-name": "cofaxAdmin",+"servlet-class": "org.cofax.cds.AdminServlet"},+{+"servlet-name": "fileServlet",+"servlet-class": "org.cofax.cds.FileServlet"},+{+"servlet-name": "cofaxTools",+"servlet-class": "org.cofax.cms.CofaxToolsServlet",+"init-param": {+"templatePath": "toolstemplates/",+"log": 1,+"logLocation": "/usr/local/tomcat/logs/CofaxTools.log",+"logMaxSize": "",+"dataLog": 1,+"dataLogLocation": "/usr/local/tomcat/logs/dataLog.log",+"dataLogMaxSize": "",+"removePageCache": "/content/admin/remove?cache=pages&id=",+"removeTemplateCache": "/content/admin/remove?cache=templates&id=",+"fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder",+"lookInContext": 1,+"adminGroupID": 4,+"betaServer": true}}],+"servlet-mapping": {+"cofaxCDS": "/",+"cofaxEmail": "/cofaxutil/aemail/*",+"cofaxAdmin": "/admin/*",+"fileServlet": "/static/*",+"cofaxTools": "/tools/*"},+"taglib": {+"taglib-uri": "cofax.tld",+"taglib-location": "/WEB-INF/tlds/cofax.tld"}}}
+ tests/in-out/JSON.out view
@@ -0,0 +1,92 @@+{"web-app":+ {"servlet":+ [{"servlet-name": "cofaxCDS",+ "servlet-class": "org.cofax.cds.CDSServlet",+ "init-param":+ {"configGlossary:installationAt": "Philadelphia, PA",+ "configGlossary:adminEmail": "ksm@pobox.com",+ "configGlossary:poweredBy": "Cofax",+ "configGlossary:poweredByIcon": "/images/cofax.gif",+ "configGlossary:staticPath": "/content/static",+ "templateProcessorClass":+ "org.cofax.WysiwygTemplate",+ "templateLoaderClass":+ "org.cofax.FilesTemplateLoader",+ "templatePath": "templates",+ "templateOverridePath": "",+ "defaultListTemplate": "listTemplate.htm",+ "defaultFileTemplate": "articleTemplate.htm",+ "useJSP": false,+ "jspListTemplate": "listTemplate.jsp",+ "jspFileTemplate": "articleTemplate.jsp",+ "cachePackageTagsTrack": 200,+ "cachePackageTagsStore": 200,+ "cachePackageTagsRefresh": 60,+ "cacheTemplatesTrack": 100,+ "cacheTemplatesStore": 50,+ "cacheTemplatesRefresh": 15,+ "cachePagesTrack": 200,+ "cachePagesStore": 100,+ "cachePagesRefresh": 10,+ "cachePagesDirtyRead": 10,+ "searchEngineListTemplate":+ "forSearchEnginesList.htm",+ "searchEngineFileTemplate": "forSearchEngines.htm",+ "searchEngineRobotsDb": "WEB-INF/robots.db",+ "useDataStore": true,+ "dataStoreClass": "org.cofax.SqlDataStore",+ "redirectionClass": "org.cofax.SqlRedirection",+ "dataStoreName": "cofax",+ "dataStoreDriver":+ "com.microsoft.jdbc.sqlserver.SQLServerDriver",+ "dataStoreUrl":+ "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",+ "dataStoreUser": "sa",+ "dataStorePassword": "dataStoreTestQuery",+ "dataStoreTestQuery":+ "SET NOCOUNT ON;select test='test';",+ "dataStoreLogFile":+ "/usr/local/tomcat/logs/datastore.log",+ "dataStoreInitConns": 10,+ "dataStoreMaxConns": 100,+ "dataStoreConnUsageLimit": 100,+ "dataStoreLogLevel": "debug",+ "maxUrlLength": 500}},+ {"servlet-name": "cofaxEmail",+ "servlet-class": "org.cofax.cds.EmailServlet",+ "init-param":+ {"mailHost": "mail1", "mailHostOverride": "mail2"}},+ {"servlet-name": "cofaxAdmin",+ "servlet-class": "org.cofax.cds.AdminServlet"},+ {"servlet-name": "fileServlet",+ "servlet-class": "org.cofax.cds.FileServlet"},+ {"servlet-name": "cofaxTools",+ "servlet-class": "org.cofax.cms.CofaxToolsServlet",+ "init-param":+ {"templatePath": "toolstemplates/",+ "log": 1,+ "logLocation":+ "/usr/local/tomcat/logs/CofaxTools.log",+ "logMaxSize": "",+ "dataLog": 1,+ "dataLogLocation":+ "/usr/local/tomcat/logs/dataLog.log",+ "dataLogMaxSize": "",+ "removePageCache":+ "/content/admin/remove?cache=pages&id=",+ "removeTemplateCache":+ "/content/admin/remove?cache=templates&id=",+ "fileTransferFolder":+ "/usr/local/tomcat/webapps/content/fileTransferFolder",+ "lookInContext": 1,+ "adminGroupID": 4,+ "betaServer": true}}],+ "servlet-mapping":+ {"cofaxCDS": "/",+ "cofaxEmail": "/cofaxutil/aemail/*",+ "cofaxAdmin": "/admin/*",+ "fileServlet": "/static/*",+ "cofaxTools": "/tools/*"},+ "taglib":+ {"taglib-uri": "cofax.tld",+ "taglib-location": "/WEB-INF/tlds/cofax.tld"}}}
+ tests/in-out/Lists.in view
@@ -0,0 +1,1 @@+[[[],hello,world ], ['c', "a rather long string that should make both the inner and the outer list to overflow; la-la-la"]]
+ tests/in-out/Lists.out view
@@ -0,0 +1,3 @@+[[[], hello, world],+ ['c',+ "a rather long string that should make both the inner and the outer list to overflow; la-la-la"]]
+ tests/in-out/Literals.in view
@@ -0,0 +1,7 @@+Lits { ints = [0,1895,-74]+ , doubles = [3.0,NaN,-18.3e-5]+ , bases = [0b011101,0x2f3d]+ , chars = ['a','\\',']','\'','\n','\10','\xA']+ , strings = ["","Hi,\n","\"\"\"","foo\&bar","foo\ \bar"]+ , unboxed = [3#]+ }
+ tests/in-out/Literals.out view
@@ -0,0 +1,8 @@+Lits+ {ints = [0, 1895, -74],+ doubles = [3.0, NaN, -18.3e-5],+ bases = [0b011101, 0x2f3d],+ chars = ['a', '\\', ']', '\'', '\n', '\10', '\xA'],+ strings =+ ["", "Hi,\n", "\"\"\"", "foo\&bar", "foo\ \bar"],+ unboxed = [3#]}
+ tests/in-out/Misc.in view
@@ -0,0 +1,2 @@+[("Text.Show.Functions", <function>),+ ("Unboxed tuple", (# 3, 5 #))]
+ tests/in-out/Misc.out view
@@ -0,0 +1,2 @@+[("Text.Show.Functions", <function>),+ ("Unboxed tuple", (# 3, 5 #))]
+ tests/in-out/Suboptimal.in view
@@ -0,0 +1,1 @@+[ ( "Unboxed strings have spaces added", "hello"# ) ]
+ tests/in-out/Suboptimal.out view
@@ -0,0 +1,1 @@+[("Unboxed strings have spaces added", "hello" #)]
+ tests/in-out/Time.in view
@@ -0,0 +1,1 @@+[ 2019-01-01 21:06:39.252923 UTC ]
+ tests/in-out/Time.out view
@@ -0,0 +1,1 @@+[2019-01-01 21:06:39.252923 UTC]
+ tests/in-out/Tuples.in view
@@ -0,0 +1,1 @@+(((),hello,world ), ('c', "a rather long string that should make both the inner and the outer tuple to overflow; la-la-la"))
+ tests/in-out/Tuples.out view
@@ -0,0 +1,3 @@+(((), hello, world),+ ('c',+ "a rather long string that should make both the inner and the outer tuple to overflow; la-la-la"))
+ tests/in-out/TypeReps.in view
@@ -0,0 +1,1 @@+[ :~: (* -> *) Maybe (Either ()) ]
+ tests/in-out/TypeReps.out view
@@ -0,0 +1,1 @@+[:~: (* -> *) Maybe (Either ())]
+ tests/in-out/UUIDs.in view
@@ -0,0 +1,2 @@+[ 613a10f6-19e4-4a11-9eed-d638cd725309,+ cb348368-0e07-11e9-ab14-d663bd873d93 ]
+ tests/in-out/UUIDs.out view
@@ -0,0 +1,2 @@+[613a10f6-19e4-4a11-9eed-d638cd725309,+ cb348368-0e07-11e9-ab14-d663bd873d93]
+ tests/in-out/Units.in view
@@ -0,0 +1,2 @@+[("Tuple unit", ( )),+ ("Empty list", [ ])]
+ tests/in-out/Units.out view
@@ -0,0 +1,1 @@+[("Tuple unit", ()), ("Empty list", [])]