Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
Journey-planner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
emanreyalp
Journey-planner
Commits
1e6a0915
Commit
1e6a0915
authored
Apr 9, 2017
by
emanreyalp
Browse files
Options
Downloads
Patches
Plain Diff
Added test for complicated routes
parent
78eb7538
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test_journey.rb
+36
-4
36 additions, 4 deletions
test_journey.rb
with
36 additions
and
4 deletions
test_journey.rb
+
36
−
4
View file @
1e6a0915
...
@@ -53,4 +53,36 @@ class TestJouney < Test::Unit::TestCase
...
@@ -53,4 +53,36 @@ class TestJouney < Test::Unit::TestCase
elements
=
journey
.
elements
elements
=
journey
.
elements
assert_equal
([
"u"
,
"v"
],
elements
)
assert_equal
([
"u"
,
"v"
],
elements
)
end
end
def
test_two_independent_route
journey
=
Journey
.
new
inserts
=
[
{
:station
=>
"u"
},
{
:station
=>
"v"
,
:criteria
=>
"w"
},
{
:station
=>
"w"
,
:criteria
=>
"z"
},
{
:station
=>
"x"
,
:criteria
=>
"u"
},
{
:station
=>
"y"
,
:criteria
=>
"v"
},
{
:station
=>
"z"
}
]
inserts
.
each
{
|
i
|
journey
.
insert
(
i
)
}
elements
=
journey
.
elements
assert_equal
([
"x"
,
"u"
,
"y"
,
"v"
,
"w"
,
"z"
],
elements
)
end
def
test_two_independent_route_mixed_inserts
journey
=
Journey
.
new
inserts
=
[
{
:station
=>
"y"
,
:criteria
=>
"v"
},
{
:station
=>
"u"
},
{
:station
=>
"v"
,
:criteria
=>
"w"
},
{
:station
=>
"x"
,
:criteria
=>
"u"
},
{
:station
=>
"w"
,
:criteria
=>
"z"
},
{
:station
=>
"z"
}
]
inserts
.
each
{
|
i
|
journey
.
insert
(
i
)
}
elements
=
journey
.
elements
assert_equal
([
"y"
,
"x"
,
"u"
,
"v"
,
"w"
,
"z"
],
elements
)
end
end
end
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