Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: test/logging_test.dart

Issue 1284983004: Also generate error when autogenerating stack traces (fix #25) (Closed) Base URL: git@github.com:dart-lang/logging.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698