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

Unified Diff: test/vm_test.dart

Issue 1654063003: pkg/stack_trace: fix vm_test (Closed) Base URL: https://github.com/dart-lang/stack_trace.git@master
Patch Set: nits Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/vm_test.dart
diff --git a/test/vm_test.dart b/test/vm_test.dart
index f0967b51024138a3fafc9ffb698b837fbb38e431..1b5345837fc0f33b2ebefbffce377e97a05d5e54 100644
--- a/test/vm_test.dart
+++ b/test/vm_test.dart
@@ -12,6 +12,12 @@ import 'package:path/path.dart' as path;
import 'package:stack_trace/stack_trace.dart';
import 'package:test/test.dart';
+// The name of this (trivial) function is verified as part of the test
+String getStackTraceString() => StackTrace.current.toString();
+
+// The name of this (trivial) function is verified as part of the test
+StackTrace getStackTraceObject() => StackTrace.current;
+
Frame getCaller([int level]) {
if (level == null) return new Frame.caller();
return new Frame.caller(level);
@@ -26,7 +32,7 @@ Trace nestedGetCurrentTrace(int level) => getCurrentTrace(level);
void main() {
group('Trace', () {
test('.parse parses a real stack trace correctly', () {
- var string = StackTrace.current.toString();
+ var string = getStackTraceString();
var trace = new Trace.parse(string);
expect(path.url.basename(trace.frames.first.uri.path),
equals('vm_test.dart'));
@@ -34,7 +40,7 @@ void main() {
});
test('converts from a native stack trace correctly', () {
- var trace = new Trace.from(StackTrace.current);
+ var trace = new Trace.from(getStackTraceObject());
expect(path.url.basename(trace.frames.first.uri.path),
equals('vm_test.dart'));
expect(trace.frames.first.member, equals('getStackTraceObject'));
« 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