make DevFSContent descendants immutable (#144664)
`DevFSBytesContent` (and it's descendant `DevFSStringContent`) have setters that change the underlying content. These are unused outside of tests, so this PR removes them. Amongst other things, this could help me refactor https://github.com/flutter/flutter/pull/144660 into something that has fewer pitfalls. This is purely a refactoring.
This commit is contained in:
@@ -67,10 +67,6 @@ void main() {
|
||||
expect(content.bytes, orderedEquals(<int>[4, 5, 6]));
|
||||
expect(content.isModified, isTrue);
|
||||
expect(content.isModified, isFalse);
|
||||
content.bytes = <int>[7, 8, 9, 2];
|
||||
expect(content.bytes, orderedEquals(<int>[7, 8, 9, 2]));
|
||||
expect(content.isModified, isTrue);
|
||||
expect(content.isModified, isFalse);
|
||||
});
|
||||
|
||||
testWithoutContext('DevFSStringContent', () {
|
||||
@@ -80,16 +76,6 @@ void main() {
|
||||
expect(content.bytes, orderedEquals(utf8.encode('some string')));
|
||||
expect(content.isModified, isTrue);
|
||||
expect(content.isModified, isFalse);
|
||||
content.string = 'another string';
|
||||
expect(content.string, 'another string');
|
||||
expect(content.bytes, orderedEquals(utf8.encode('another string')));
|
||||
expect(content.isModified, isTrue);
|
||||
expect(content.isModified, isFalse);
|
||||
content.bytes = utf8.encode('foo bar');
|
||||
expect(content.string, 'foo bar');
|
||||
expect(content.bytes, orderedEquals(utf8.encode('foo bar')));
|
||||
expect(content.isModified, isTrue);
|
||||
expect(content.isModified, isFalse);
|
||||
});
|
||||
|
||||
testWithoutContext('DevFSFileContent', () async {
|
||||
|
||||
Reference in New Issue
Block a user