-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix issue 669 * Update CHANGELOG.md * Update CHANGELOG.md * Fix dart format issue. Fix prefer single quote issue. * Update pubspec and changelog to avoid merge check publish / validate validate packages * Add test for GRPC Compression Flag * Fix dart analyze issues. * Fix latest dart analyze issue (uninizialized variable)
- Loading branch information
1 parent
bb8b6e5
commit bdbe5f5
Showing
4 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'package:grpc/src/shared/codec.dart'; | ||
import 'package:grpc/src/shared/message.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
group('GRPC Compression Flag', () { | ||
test('compression flag 0 with null codec', () { | ||
final rawPayload = <int>[1, 2, 3, 4]; | ||
final Codec? codec = null; | ||
final data = frame(rawPayload, codec); | ||
expect(data[0], 0); | ||
}); | ||
test('compression flag 0 with grpc-encoding identity', () { | ||
final rawPayload = <int>[1, 2, 3, 4]; | ||
final Codec codec = IdentityCodec(); | ||
final data = frame(rawPayload, codec); | ||
expect(data[0], 0); | ||
}); | ||
test('compression flag 1 with grpc-encoding gzip', () { | ||
final rawPayload = <int>[1, 2, 3, 4]; | ||
final Codec codec = GzipCodec(); | ||
final data = frame(rawPayload, codec); | ||
expect(data[0], 1); | ||
}); | ||
}); | ||
} |