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

Unified Diff: pkg/logging/test/logging_test.dart

Issue 88323004: pkg/logging: expose static sorted const list of all levels (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/logging/lib/logging.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/logging/test/logging_test.dart
diff --git a/pkg/logging/test/logging_test.dart b/pkg/logging/test/logging_test.dart
index a188bb5ebd8c75f35733eaab6e543b2344c1d7cd..82ef3e12adaa4d04906181e4f85e9278250897c6 100644
--- a/pkg/logging/test/logging_test.dart
+++ b/pkg/logging/test/logging_test.dart
@@ -29,10 +29,7 @@ main() {
});
test('default levels are in order', () {
- final levels = const [
- Level.ALL, Level.FINEST, Level.FINER, Level.FINE, Level.CONFIG,
- Level.INFO, Level.WARNING, Level.SEVERE, Level.SHOUT, Level.OFF
- ];
+ final levels = Level.LEVELS;
for (int i = 0; i < levels.length; i++) {
for (int j = i + 1; j < levels.length; j++) {
@@ -46,13 +43,12 @@ main() {
Level.INFO, Level.CONFIG, Level.FINE, Level.SHOUT, Level.OFF,
Level.FINER, Level.ALL, Level.WARNING, Level.FINEST, Level.SEVERE,
];
- final sorted = const [
- Level.ALL, Level.FINEST, Level.FINER, Level.FINE, Level.CONFIG,
- Level.INFO, Level.WARNING, Level.SEVERE, Level.SHOUT, Level.OFF
- ];
+
+ final sorted = Level.LEVELS;
+
expect(unsorted, isNot(orderedEquals(sorted)));
- unsorted.sort((a, b) => a.compareTo(b));
+ unsorted.sort();
kevmoo-old 2013/11/26 19:23:13 sort uses static Comparable.compare which calls th
expect(unsorted, orderedEquals(sorted));
});
@@ -65,7 +61,7 @@ main() {
});
test('logger name cannot start with a "." ', () {
- expect(() => new Logger('.c'), throws);
+ expect(() => new Logger('.c'), throwsArgumentError);
Siggi Cherem (dart-lang) 2013/11/26 19:25:49 mmm. I wonder if this should be an argument error
kevmoo-old 2013/11/26 20:39:33 It's arguable at best. I didn't change the existin
});
test('logger naming is hierarchical', () {
« no previous file with comments | « pkg/logging/lib/logging.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698