Skip to content

Commit

Permalink
Update unit test to also handle null and zero-byte message differently (
Browse files Browse the repository at this point in the history
  • Loading branch information
mravn-google authored Apr 8, 2017
1 parent 68194b8 commit 3035ed8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

TEST(FlutterStringCodec, CanEncodeAndDecodeEmptyString) {
FlutterStringCodec* codec = [FlutterStringCodec sharedInstance];
ASSERT_TRUE([codec encode:@""] == nil);
ASSERT_TRUE([codec decode:[NSData data]] == nil);
ASSERT_TRUE([[codec encode:@""] isEqualTo:[NSData data]]);
ASSERT_TRUE([[codec decode:[NSData data]] isEqualTo:@""]);
}

TEST(FlutterStringCodec, CanEncodeAndDecodeAsciiString) {
Expand Down Expand Up @@ -42,10 +42,9 @@
}

TEST(FlutterJSONCodec, CanEncodeAndDecodeNil) {
FlutterStringCodec* codec = [FlutterStringCodec sharedInstance];
FlutterJSONMessageCodec* codec = [FlutterJSONMessageCodec sharedInstance];
ASSERT_TRUE([codec encode:nil] == nil);
ASSERT_TRUE([codec decode:nil] == nil);
ASSERT_TRUE([codec decode:[NSData data]] == nil);
}

TEST(FlutterJSONCodec, CanEncodeAndDecodeArray) {
Expand Down

0 comments on commit 3035ed8

Please sign in to comment.