mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Ruby test hardness for ghci
This commit is contained in:
parent
cbdb932af8
commit
b0311ff77e
@ -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)
|
||||
|
4
test/fixtures/ruby/reprinting/function.rb
vendored
Normal file
4
test/fixtures/ruby/reprinting/function.rb
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
def foo(x)
|
||||
x
|
||||
5
|
||||
end
|
Loading…
Reference in New Issue
Block a user