Skip to content

Commit

Permalink
Update file name generation (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZimboPro authored Jan 31, 2025
1 parent 3c1640f commit 7c6c80a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/screenshot/screenshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Future<Screenshot> takeScreenshot({
final file = frame?.uri.pathSegments.last.replaceFirst('.dart', '');
final line = frame?.line;
if (file != null && line != null) {
return '$file:$line';
return '${file}_$line';
}
if (file != null) {
return file;
Expand Down
2 changes: 1 addition & 1 deletion test/screenshot/screenshot_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void main() {
testWidgets('screenshot file name contains test file name', (tester) async {
final shot = await takeScreenshot();
final lineNumber = _currentLineNumber() - 1;
expect(shot.file.name, contains('screenshot_test:$lineNumber'));
expect(shot.file.name, contains('screenshot_test_$lineNumber'));
});

testWidgets('name gets escaped to prevent slashes', (tester) async {
Expand Down

0 comments on commit 7c6c80a

Please sign in to comment.