Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
c4176b3f
Commit
c4176b3f
authored
Dec 24, 2013
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean
parent
502d90fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Hspec.hs
Hspec.hs
+4
-4
No files found.
Hspec.hs
View file @
c4176b3f
...
@@ -11,7 +11,7 @@ import Data.String.Utils (strip, replace)
...
@@ -11,7 +11,7 @@ import Data.String.Utils (strip, replace)
import
IHaskell.Eval.Parser
import
IHaskell.Eval.Parser
import
IHaskell.Types
import
IHaskell.Types
import
IHaskell.IPython
import
IHaskell.IPython
import
IHaskell.Eval.Evaluate
import
IHaskell.Eval.Evaluate
as
Eval
import
IHaskell.Eval.Completion
import
IHaskell.Eval.Completion
import
Test.Hspec
import
Test.Hspec
...
@@ -31,7 +31,7 @@ eval string = do
...
@@ -31,7 +31,7 @@ eval string = do
outputAccum
<-
newIORef
[]
outputAccum
<-
newIORef
[]
let
publish
_
displayDatas
=
modifyIORef
outputAccum
(
displayDatas
:
)
let
publish
_
displayDatas
=
modifyIORef
outputAccum
(
displayDatas
:
)
getTemporaryDirectory
>>=
setCurrentDirectory
getTemporaryDirectory
>>=
setCurrentDirectory
interpret
$
evaluate
1
string
publish
interpret
$
Eval
.
evaluate
1
string
publish
out
<-
readIORef
outputAccum
out
<-
readIORef
outputAccum
return
$
reverse
out
return
$
reverse
out
...
@@ -58,7 +58,7 @@ becomes string expected = do
...
@@ -58,7 +58,7 @@ becomes string expected = do
Nothing
->
expectationFailure
$
"No plain-text output in "
++
show
result
Nothing
->
expectationFailure
$
"No plain-text output in "
++
show
result
completes
string
expected
=
completionTarget
newString
cursorloc
`
shouldBe
`
expected
completes
string
expected
=
completionTarget
newString
cursorloc
`
shouldBe
`
expected
where
(
newString
,
cursorloc
)
=
case
findIndex
(
==
'!'
)
string
of
where
(
newString
,
cursorloc
)
=
case
elemIndex
'!'
string
of
Nothing
->
error
"Expected cursor written as '!'."
Nothing
->
error
"Expected cursor written as '!'."
Just
idx
->
(
replace
"!"
""
string
,
idx
)
Just
idx
->
(
replace
"!"
""
string
,
idx
)
...
@@ -69,7 +69,7 @@ completionHas string expected = do
...
@@ -69,7 +69,7 @@ completionHas string expected = do
let
existsInCompletion
=
(`
elem
`
completions
)
let
existsInCompletion
=
(`
elem
`
completions
)
unmatched
=
filter
(
not
.
existsInCompletion
)
expected
unmatched
=
filter
(
not
.
existsInCompletion
)
expected
unmatched
`
shouldBe
`
[]
unmatched
`
shouldBe
`
[]
where
(
newString
,
cursorloc
)
=
case
findIndex
(
==
'!'
)
string
of
where
(
newString
,
cursorloc
)
=
case
elemIndex
'!'
string
of
Nothing
->
error
"Expected cursor written as '!'."
Nothing
->
error
"Expected cursor written as '!'."
Just
idx
->
(
replace
"!"
""
string
,
idx
)
Just
idx
->
(
replace
"!"
""
string
,
idx
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment