1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Ruby test hardness for ghci

This commit is contained in:
Timothy Clem 2018-08-20 18:11:41 -07:00
parent cbdb932af8
commit b0311ff77e
2 changed files with 15 additions and 0 deletions

View File

@ -40,6 +40,7 @@ import Data.Term
import Language.Haskell.HsColour
import Language.Haskell.HsColour.Colourise
import Language.JSON.Translate
import Language.Ruby.Translate
import Matching.Core
import Parsing.Parser
import Prologue hiding (weaken)
@ -156,6 +157,16 @@ prettyShow = putStrLn . hscolour TTY defaultColourPrefs False False "" False . p
-- Code rewriting experiments
--
testRubyFile = do
let path = "test/fixtures/ruby/reprinting/function.rb"
src <- blobSource <$> readBlobFromPath (File path Language.Ruby)
tree <- parseFile miniRubyParser path
pure (src, tree)
testRubyPipeline = do
(src, tree) <- testRubyFile
printToTerm $ runReprinter src translatingRuby (mark Refactored tree)
testJSONFile = do
let path = "test/fixtures/javascript/reprinting/map.json"
src <- blobSource <$> readBlobFromPath (File path Language.JSON)

View File

@ -0,0 +1,4 @@
def foo(x)
x
5
end