Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
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
abdullh.alsoleman
Front-End
Commits
df2eb202
Commit
df2eb202
authored
Jun 26, 2015
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor: A slightly more contrived test case to verify contraint priorities
parent
e65fd76e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
cassowary_test.dart
packages/cassowary/test/cassowary_test.dart
+26
-0
No files found.
packages/cassowary/test/cassowary_test.dart
View file @
df2eb202
...
...
@@ -501,4 +501,30 @@ void main() {
expect
(
s
.
toString
()
!=
null
,
true
);
});
test
(
'solution_with_optimize'
,
()
{
Param
p1
=
new
Param
();
Param
p2
=
new
Param
();
Param
p3
=
new
Param
();
Param
container
=
new
Param
();
Solver
solver
=
new
Solver
();
solver
.
addEditVariable
(
container
.
variable
,
Priority
.
strong
);
solver
.
suggestValueForVariable
(
container
.
variable
,
100.0
);
solver
.
addConstraint
((
p1
>=
CM
(
30.0
))
|
Priority
.
strong
);
solver
.
addConstraint
(((
p1
==
p3
)
as
Constraint
)
|
Priority
.
medium
);
solver
.
addConstraint
((
p2
==
CM
(
2.0
)
*
p1
)
as
Constraint
);
solver
.
addConstraint
((
container
==
(
p1
+
p2
+
p3
))
as
Constraint
);
solver
.
flushVariableUpdates
();
expect
(
container
.
value
,
100.0
);
expect
(
p1
.
value
,
30.0
);
expect
(
p2
.
value
,
60.0
);
expect
(
p3
.
value
,
10.0
);
});
}
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