Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed Jul 11, 2023
1 parent 982a05e commit f4fe7af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 10 additions & 4 deletions pkgs/leak_tracker/test/debug/leak_tracking/orchestration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
import 'package:leak_tracker/leak_tracker.dart';
import 'package:test/test.dart';

class MyClass {
MyClass();

final Stopwatch stopwatch = Stopwatch();
WeakReference<Stopwatch> get ref => WeakReference(stopwatch);
}

void main() {
final myObject = MyClass();
test('formattedRetainingPath returns path', () async {
final Object myObject = <int>[1, 2, 3, 4, 5];
final path = await formattedRetainingPath(WeakReference(myObject));

print(path);
final path = await formattedRetainingPath(myObject.ref);
expect(path, contains('_test.dart/MyClass:stopwatch'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ void main() {
final instance = MyClass();

final path = await obtainRetainingPath(
instance.runtimeType, identityHashCode(instance));
instance.runtimeType,
identityHashCode(instance),
);
expect(path!.elements, isNotEmpty);
});

Expand Down

0 comments on commit f4fe7af

Please sign in to comment.