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')); |