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
882a17f7
Commit
882a17f7
authored
Jun 25, 2015
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor: Add more tests
parent
8be3c640
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
solver.dart
packages/cassowary/lib/solver.dart
+1
-1
cassowary_test.dart
packages/cassowary/test/cassowary_test.dart
+26
-0
No files found.
packages/cassowary/lib/solver.dart
View file @
882a17f7
...
...
@@ -140,7 +140,7 @@ class Solver {
return
_dualOptimize
();
}
void
updateVariable
()
{
void
flushVariableUpdates
()
{
for
(
Variable
variable
in
_vars
.
keys
)
{
_Symbol
symbol
=
_vars
[
variable
];
_Row
row
=
_rows
[
symbol
];
...
...
packages/cassowary/test/cassowary_test.dart
View file @
882a17f7
...
...
@@ -422,4 +422,30 @@ void main() {
expect
(((
left
+
right
)
>=
(
CM
(
2.0
)
*
mid
))
is
Constraint
,
true
);
});
test
(
'single_item'
,
()
{
var
left
=
new
Param
(-
20.0
);
Solver
s
=
new
Solver
();
s
<<
(
left
>=
CM
(
0.0
));
s
.
flushVariableUpdates
();
expect
(
left
.
value
,
0.0
);
});
test
(
'midpoints'
,
()
{
var
left
=
new
Param
(
0.0
);
var
right
=
new
Param
(
0.0
);
var
mid
=
new
Param
(
0.0
);
Solver
s
=
new
Solver
();
s
<<
((
left
+
right
==
CM
(
2.0
)
*
mid
)
as
Constraint
);
s
<<
(
right
-
left
>=
CM
(
100.0
));
s
<<
(
left
>=
CM
(
0.0
));
s
.
flushVariableUpdates
();
expect
(
left
.
value
,
0.0
);
expect
(
mid
.
value
,
50.0
);
expect
(
right
.
value
,
100.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