| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
test_write_read_bytes_can_be_read_as_string() {
var expectedContent = "æble";
File file = _file(exists: true, content: expectedContent);
expect(file.readAsStringSync(), expectedContent);
var byteContent = file.readAsBytesSync();
file.writeAsBytesSync(byteContent);
expect(file.readAsStringSync(), expectedContent);
}
How is this related to the change?
expect(() => file.writeAsBytesSync(bytes), throwsA(_isFileSystemException));Why is there no update to the test? Did it not fail before?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
test_write_read_bytes_can_be_read_as_string() {
var expectedContent = "æble";
File file = _file(exists: true, content: expectedContent);
expect(file.readAsStringSync(), expectedContent);
var byteContent = file.readAsBytesSync();
file.writeAsBytesSync(byteContent);
expect(file.readAsStringSync(), expectedContent);
}
How is this related to the change?
It's the test for it working (vs not working before)...
Reading as bytes returns the string utf-8 encoded, whereas writing it as bytes used to create a string from the bytes as if they were code units, creating a string of the same length as the list of bytes. For "æble" that becomes 5 bytes/a string of length 5 (with the first two characters being nonsense).
Or am I misreading the question?
expect(() => file.writeAsBytesSync(bytes), throwsA(_isFileSystemException));Why is there no update to the test? Did it not fail before?
No. Char-code 99 (`c`) is in ansi-range so the utf8-encoding is the same. Well i suppose that would be the explanation above --- here it is expected to throw because it will not write to a file with an overlay...
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
test_write_read_bytes_can_be_read_as_string() {
var expectedContent = "æble";
File file = _file(exists: true, content: expectedContent);
expect(file.readAsStringSync(), expectedContent);
var byteContent = file.readAsBytesSync();
file.writeAsBytesSync(byteContent);
expect(file.readAsStringSync(), expectedContent);
}
Jens JohansenHow is this related to the change?
It's the test for it working (vs not working before)...
Reading as bytes returns the string utf-8 encoded, whereas writing it as bytes used to create a string from the bytes as if they were code units, creating a string of the same length as the list of bytes. For "æble" that becomes 5 bytes/a string of length 5 (with the first two characters being nonsense).
Or am I misreading the question?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[analyzer] Fix _OverlayFile.writeAsBytesSync
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |