Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mockup-generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dosek-verification
mockup-generator
Commits
8d61d4f9
Commit
8d61d4f9
authored
8 years ago
by
Hans-Peter Deifel
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests after SSEGraph changes
parent
0729c2c9
Branches
pie-cts-release
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/Compare/PreprocessSpec.hs
+16
-13
16 additions, 13 deletions
test/Compare/PreprocessSpec.hs
with
16 additions
and
13 deletions
test/Compare/PreprocessSpec.hs
+
16
−
13
View file @
8d61d4f9
...
@@ -3,11 +3,13 @@ module Compare.PreprocessSpec (spec) where
...
@@ -3,11 +3,13 @@ module Compare.PreprocessSpec (spec) where
import
Test.Hspec
import
Test.Hspec
import
qualified
Data.Graph.Inductive.Graph
as
G
import
Lens.Micro
import
Lens.Micro
import
Compare.Preprocess
import
Compare.Preprocess
import
Compare.Types
import
Compare.Types
import
Compare.Types.Lenses
import
Compare.Types.Lenses
import
Compare.SSEGraph
spec
::
Spec
spec
::
Spec
spec
=
do
spec
=
do
...
@@ -18,31 +20,32 @@ spec = do
...
@@ -18,31 +20,32 @@ spec = do
renameStartOSSpec
::
Spec
renameStartOSSpec
::
Spec
renameStartOSSpec
=
do
renameStartOSSpec
=
do
it
"does nothing for a graph without StartOS label"
$
it
"does nothing for a graph without StartOS label"
$
let
g
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"edge"
)]
"a"
let
g
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"edge
/Foo
"
)]
"a"
in
preprocess
g
`
shouldBe
`
g
in
preprocess
(
g
&
edges
%~
SSEEdgeLabel
)
`
shouldBe
`
g
it
"renames the StartOS label"
$
it
"renames the StartOS label"
$
let
g1
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"ABB13/StartOS"
)]
"a"
let
g1
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"ABB13/StartOS"
)]
"a"
g2
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"StartOS"
)]
"a"
g2
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"StartOS"
)]
"a"
in
preprocess
g1
`
shouldBe
`
g2
in
preprocess
(
g1
&
edges
%~
SSEEdgeLabel
)
`
shouldBe
`
g2
renameIdleSpec
::
Spec
renameIdleSpec
::
Spec
renameIdleSpec
=
do
renameIdleSpec
=
do
it
"does nothing for a graph without StartOS label"
$
it
"does nothing for a graph without StartOS label"
$
let
g
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"edge"
)]
"a"
let
g
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"edge
/Foo
"
)]
"a"
in
preprocess
g
`
shouldBe
`
g
in
preprocess
(
g
&
edges
%~
SSEEdgeLabel
)
`
shouldBe
`
g
it
"renames the idle loop edge label"
$
it
"renames the idle loop edge label"
$
let
g1
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"ABB25/Idle"
)]
"a"
let
g1
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"ABB25/Idle"
)]
"a"
g2
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"Idle"
)]
"a"
g2
=
mkGraph
[
"a"
,
"b"
]
[(
"a"
,
"b"
,
"Idle"
)]
"a"
in
preprocess
g1
`
shouldBe
`
g2
in
preprocess
(
g1
&
edges
%~
SSEEdgeLabel
)
`
shouldBe
`
g2
renameIdleKickoffSpec
::
Spec
renameIdleKickoffSpec
::
Spec
renameIdleKickoffSpec
=
renameIdleKickoffSpec
=
it
"renames the kickoff label to the idle thread"
$
it
"renames the kickoff label to the idle thread"
$
let
g1
=
mkGraph
[
"PreIdle"
,
"Idle"
]
[
(
"PreIdle"
,
"Idle"
,
"ABB42/kickoff"
)
let
g1
=
mkGraph
[
"PreIdle"
,
"Idle"
]
[
(
"PreIdle"
,
"Idle"
,
"ABB42/kickoff"
)
,
(
"Idle"
,
"Idle"
,
"Idle"
)
-- self loop
,
(
"Idle"
,
"Idle"
,
"
ABB5/
Idle"
)
-- self loop
]
]
"PreIdle"
"PreIdle"
g2
=
g1
&
edges
.
filtered
(
==
"ABB42/kickoff"
)
.~
"IdleKickoff"
g2
=
g1
&
edges
.
filtered
(
==
"ABB42/kickoff"
)
.~
"IdleKickoff"
in
preprocess
g1
`
shouldBe
`
g2
&
edges
.
filtered
(
==
"ABB5/Idle"
)
.~
"Idle"
in
preprocess
(
g1
&
_graph
%~
G
.
emap
SSEEdgeLabel
)
`
shouldBe
`
g2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment