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
92e3e96a
Commit
92e3e96a
authored
Nov 04, 2015
by
Matt Perry
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1949 from mpcomplete/async
Remove use of FakeAsync in signing_test.dart
parents
ba3f60f8
6185fa14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
29 deletions
+14
-29
signing_test.dart
packages/unit/test/flx/signing_test.dart
+14
-29
No files found.
packages/unit/test/flx/signing_test.dart
View file @
92e3e96a
...
...
@@ -6,7 +6,6 @@ import 'package:bignum/bignum.dart';
import
'package:cipher/cipher.dart'
hide
CipherParameters
;
import
'package:crypto/crypto.dart'
;
import
'package:flx/signing.dart'
;
import
'package:quiver/testing/async.dart'
;
import
'package:test/test.dart'
;
main
()
async
{
...
...
@@ -97,33 +96,19 @@ main() async {
expect
(
verifies
,
equals
(
false
),
reason:
failReason
);
});
test
(
'verifyContentHash works'
,
()
{
new
FakeAsync
().
run
((
FakeAsync
async
)
{
bool
verifies
;
Stream
contentStream
=
new
Stream
.
fromIterable
(
kTestBytesList
);
verifyContentHash
(
new
BigInteger
(
kTestHash
),
contentStream
).
then
((
bool
rv
)
{
verifies
=
rv
;
});
async
.
elapse
(
Duration
.
ZERO
);
expect
(
verifies
,
equals
(
true
));
// Ensure it fails with invalid hash or content.
verifies
=
null
;
contentStream
=
new
Stream
.
fromIterable
(
kTestBytesList
);
verifyContentHash
(
new
BigInteger
(
0xdeadbeef
),
contentStream
).
then
((
bool
rv
)
{
verifies
=
rv
;
});
async
.
elapse
(
Duration
.
ZERO
);
expect
(
verifies
,
equals
(
false
));
verifies
=
null
;
Stream
badContentStream
=
new
Stream
.
fromIterable
([
new
Uint8List
.
fromList
(<
int
>[
42
])]);
verifyContentHash
(
new
BigInteger
(
kTestHash
),
badContentStream
).
then
((
bool
rv
)
{
verifies
=
rv
;
});
async
.
elapse
(
Duration
.
ZERO
);
expect
(
verifies
,
equals
(
false
));
});
test
(
'verifyContentHash works'
,
()
async
{
Stream
contentStream
=
new
Stream
.
fromIterable
(
kTestBytesList
);
bool
verifies
=
await
verifyContentHash
(
new
BigInteger
(
kTestHash
),
contentStream
);
expect
(
verifies
,
equals
(
true
));
// Ensure it fails with invalid hash or content.
contentStream
=
new
Stream
.
fromIterable
(
kTestBytesList
);
verifies
=
await
verifyContentHash
(
new
BigInteger
(
0xdeadbeef
),
contentStream
);
expect
(
verifies
,
equals
(
false
));
Stream
badContentStream
=
new
Stream
.
fromIterable
([
new
Uint8List
.
fromList
(<
int
>[
42
])]);
verifies
=
await
verifyContentHash
(
new
BigInteger
(
kTestHash
),
badContentStream
);
expect
(
verifies
,
equals
(
false
));
});
}
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