Skip to content

Commit

Permalink
. r formatted, deleted colorize
Browse files Browse the repository at this point in the history
  • Loading branch information
yelmuratoff committed May 17, 2024
1 parent 676104f commit 715de19
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 27 deletions.
1 change: 0 additions & 1 deletion lib/approval_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ part 'src/exceptions/doesnt_match_exception.dart';
part 'src/exceptions/ide_comparator_exception.dart';
part 'src/namer/file_namer_options.dart';
part 'src/namer/namer.dart';
part 'src/reporters/command_line/colorize.dart';
part 'src/reporters/command_line/command_line_reporter.dart';
part 'src/reporters/diff_tool/diff_info.dart';
part 'src/reporters/diff_tool/diff_tool_reporter.dart';
Expand Down
19 changes: 0 additions & 19 deletions lib/src/reporters/command_line/colorize.dart

This file was deleted.

6 changes: 5 additions & 1 deletion lib/src/reporters/command_line/command_line_reporter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ class CommandLineReporter implements Reporter {
}
}

String _highlightDifference(String approvedLine, String receivedLine, {bool isApprovedFile = false}) {
String _highlightDifference(
String approvedLine,
String receivedLine, {
bool isApprovedFile = false,
}) {
// Create a new instance of DiffMatchPatch
final differ = DiffMatchPatch();

Expand Down
3 changes: 2 additions & 1 deletion lib/src/reporters/diff_tool/diff_tool_reporter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class DiffReporter implements Reporter {
rethrow;
}
throw IDEComparatorException(
message: 'Error during comparison via ${ide.name}. Please try check path to IDE. \n Current path: ${diffInfo.command}.',
message:
'Error during comparison via ${ide.name}. Please try check path to IDE. \n Current path: ${diffInfo.command}.',
exception: e,
stackTrace: st,
);
Expand Down
3 changes: 1 addition & 2 deletions lib/src/reporters/diff_tool/diff_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ part of '../../../../approval_tests.dart';
/// `MacDiffTools` contains diff tools available on macOS.
final class MacDiffTools {
static const DiffInfo visualStudioCode = DiffInfo(
command:
'/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code',
command: '/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code',
arg: '-d',
);

Expand Down
11 changes: 8 additions & 3 deletions test/approval_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ void main() {
);
});

test("Method «verify» must throw DoesntMatchException with error handling", () {
test("Method «verify» must throw DoesntMatchException with error handling",
() {
expect(
() => helper.verify(
'Hello W0rld',
Expand All @@ -115,7 +116,9 @@ void main() {
ApprovalLogger.log("$lines25 Group: Minor cases are starting $lines25");
});

test('Simulate file not found error during comparison. Must throw CommandLineComparatorException.', () async {
test(
'Simulate file not found error during comparison. Must throw CommandLineComparatorException.',
() async {
const comparator = FileComparator();

// Setup: paths to non-existent files
Expand All @@ -136,7 +139,9 @@ void main() {
);
});

test('Simulate file not found error during comparison. Must throw IDEComparatorException.', () async {
test(
'Simulate file not found error during comparison. Must throw IDEComparatorException.',
() async {
const reporter = DiffReporter();

// Setup: paths to non-existent files
Expand Down

0 comments on commit 715de19

Please sign in to comment.