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
9d075ada
Commit
9d075ada
authored
Jun 25, 2015
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor: Add tests to check for addition of multiple constraints
parent
a029c93e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
solver.dart
packages/cassowary/lib/solver.dart
+1
-1
cassowary_test.dart
packages/cassowary/test/cassowary_test.dart
+19
-0
No files found.
packages/cassowary/lib/solver.dart
View file @
9d075ada
...
...
@@ -18,7 +18,7 @@ class Solver {
/// add any for some reason, a cleanup is attempted so that either all
/// constraints will be added or none.
Result
addConstraints
(
List
<
Constraint
>
constraints
)
{
List
<
Constraint
>
added
=
new
List
<
Constraint
>(
constraints
.
length
);
List
<
Constraint
>
added
=
new
List
<
Constraint
>();
bool
needsCleanup
=
false
;
Result
result
=
Result
.
success
;
...
...
packages/cassowary/test/cassowary_test.dart
View file @
9d075ada
...
...
@@ -449,4 +449,23 @@ void main() {
expect
(
mid
.
value
,
50.0
);
expect
(
right
.
value
,
100.0
);
});
test
(
'addition_of_multiple'
,
()
{
var
left
=
new
Param
(
0.0
);
var
right
=
new
Param
(
0.0
);
var
mid
=
new
Param
(
0.0
);
Solver
s
=
new
Solver
();
var
c
=
(
left
>=
CM
(
0.0
));
expect
(
s
.
addConstraints
([
(
left
+
right
==
CM
(
2.0
)
*
mid
)
as
Constraint
,
(
right
-
left
>=
CM
(
100.0
)),
c
]),
Result
.
success
);
expect
(
s
.
addConstraints
([(
right
>=
CM
(-
20.0
)),
c
]),
Result
.
duplicateConstraint
);
});
}
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