File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -172,11 +172,9 @@ class EventSource {
172172 _nextEventName = value;
173173 } else if (name == 'data' ) {
174174 if (_nextData == null ) {
175- _nextData = value;
176- } else {
177- _nextData += '\n $value ' ;
175+ _nextData = '' ;
178176 }
179- _nextEventName = null ;
177+ _nextData += '$ value \n ' ;
180178 } else if (name == 'id' ) {
181179 _lastEventID = value;
182180 } else if (name == 'retry' ) {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ void main() {
2626 });
2727
2828 test ('opens and closes connection when listening on `events`' , () async {
29- final data = 'example data' ;
29+ final data = 'example data\n ' ;
3030
3131 _responses = [
3232 'retry:10000' ,
@@ -55,7 +55,7 @@ void main() {
5555 final second = events.elementAt (1 );
5656
5757 final message = await first;
58- expect (message.data, equals ('example' ));
58+ expect (message.data, equals ('example\n ' ));
5959
6060 // Kill the connection
6161 final port = server.port;
@@ -68,6 +68,6 @@ void main() {
6868 });
6969
7070 final message2 = await second;
71- expect (message2.data, equals ('back' ));
71+ expect (message2.data, equals ('back\n ' ));
7272 });
7373}
You can’t perform that action at this time.
0 commit comments