-
Notifications
You must be signed in to change notification settings - Fork 25
Add chunked decoding support to CodePage #91
Add chunked decoding support to CodePage #91
Conversation
Add chunked decoding support (`startChunkedConversion`) for `CodePage` encodings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. And good tests!
}); | ||
|
||
test('chunked conversion', () { | ||
late final String decodedString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just initialize it to ""
instead of being late
. (I don't like late
😉 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like mutability ;-) I'd prefer to have late
and make it final
rather lose the final
specifier ;-)
test/codepage_test.dart
Outdated
group('Custom code page', () { | ||
late final CodePage cp; | ||
|
||
setUpAll(() => cp = CodePage('custom', "ABCDEF${"\uFFFD" * 250}")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code pages should be immutable, so just initialize it directly, without using setUp
. (I also don't like setUp
😁).
Unless you fear that it will throw?
(What's the difference between setUp
and setUpAll
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setUp runs for each embedded test, setUpAll runs once.
Done.
FYI, I changed the minimum supported SDK version to 3.0 to get the |
startChunkedConversion
) forCodePage
encodings. This is straightforward becauseCodePage
encodings map a single byte to set of code units so state must be preserved between chunks.Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.