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
d8d07a31
Commit
d8d07a31
authored
Jun 26, 2015
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests edit constraints
parent
97cd09d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
cassowary_test.dart
packages/cassowary/test/cassowary_test.dart
+22
-0
No files found.
packages/cassowary/test/cassowary_test.dart
View file @
d8d07a31
...
...
@@ -468,4 +468,26 @@ void main() {
expect
(
s
.
addConstraints
([(
right
>=
CM
(-
20.0
)),
c
]),
Result
.
duplicateConstraint
);
});
test
(
'edit_constraints'
,
()
{
var
left
=
new
Param
(
0.0
)..
name
=
"left"
;
var
right
=
new
Param
(
0.0
)..
name
=
"right"
;
var
mid
=
new
Param
(
0.0
)..
name
=
"mid"
;
Solver
s
=
new
Solver
();
expect
(
s
.
addConstraint
((
right
+
left
==
mid
*
CM
(
2.0
))
as
Constraint
),
Result
.
success
);
expect
(
s
.
addConstraint
(
right
-
left
>=
CM
(
100.0
)),
Result
.
success
);
expect
(
s
.
addConstraint
(
left
>=
CM
(
0.0
)),
Result
.
success
);
expect
(
s
.
addEditVariable
(
mid
.
variable
,
Priority
.
strong
),
Result
.
success
);
expect
(
s
.
suggestValueForVariable
(
mid
.
variable
,
300.0
),
Result
.
success
);
s
.
flushVariableUpdates
();
expect
(
left
.
value
,
0.0
);
expect
(
mid
.
value
,
300.0
);
expect
(
right
.
value
,
600.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