| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library logging_test; | 5 library logging_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:logging/logging.dart'; | 9 import 'package:logging/logging.dart'; |
| 10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 } | 562 } |
| 563 var records = new List<LogRecord>(); | 563 var records = new List<LogRecord>(); |
| 564 recordStackTraceAtLevel = Level.WARNING; | 564 recordStackTraceAtLevel = Level.WARNING; |
| 565 root.onRecord.listen(records.add); | 565 root.onRecord.listen(records.add); |
| 566 root.severe('hello'); | 566 root.severe('hello'); |
| 567 root.warning('hello', 'a', trace); | 567 root.warning('hello', 'a', trace); |
| 568 expect(records, hasLength(2)); | 568 expect(records, hasLength(2)); |
| 569 expect(records[0].stackTrace, isNot(equals(trace))); | 569 expect(records[0].stackTrace, isNot(equals(trace))); |
| 570 expect(records[1].stackTrace, trace); | 570 expect(records[1].stackTrace, trace); |
| 571 }); | 571 }); |
| 572 |
| 573 test('error also generated when generating a trace', () { |
| 574 var records = new List<LogRecord>(); |
| 575 recordStackTraceAtLevel = Level.WARNING; |
| 576 root.onRecord.listen(records.add); |
| 577 root.severe('hello'); |
| 578 root.warning('hello'); |
| 579 root.info('hello'); |
| 580 expect(records, hasLength(3)); |
| 581 expect(records[0].error, isNotNull); |
| 582 expect(records[1].error, isNotNull); |
| 583 expect(records[2].error, isNull); |
| 584 }); |
| 572 }); | 585 }); |
| 573 } | 586 } |
| OLD | NEW |