chore: format code

This commit is contained in:
fiatcode 2026-02-24 10:56:30 +07:00
parent e5a651951d
commit d3c7eb9de7
2 changed files with 40 additions and 10 deletions

View file

@ -1,5 +1,5 @@
import 'package:test/test.dart';
import 'package:tdd_katas/mars_rover.dart'; import 'package:tdd_katas/mars_rover.dart';
import 'package:test/test.dart';
void main() { void main() {
group('Mars Rover:', () { group('Mars Rover:', () {
@ -131,31 +131,61 @@ void main() {
group('Plateau Boundaries:', () { group('Plateau Boundaries:', () {
test('wraps around when moving North past boundary', () { test('wraps around when moving North past boundary', () {
final rover = Rover(x: 0, y: 5, direction: 'N', plateauWidth: 5, plateauHeight: 5); final rover = Rover(
x: 0,
y: 5,
direction: 'N',
plateauWidth: 5,
plateauHeight: 5,
);
rover.moveForward(); rover.moveForward();
expect(rover.y, equals(0)); expect(rover.y, equals(0));
}); });
test('wraps around when moving East past boundary', () { test('wraps around when moving East past boundary', () {
final rover = Rover(x: 5, y: 0, direction: 'E', plateauWidth: 5, plateauHeight: 5); final rover = Rover(
x: 5,
y: 0,
direction: 'E',
plateauWidth: 5,
plateauHeight: 5,
);
rover.moveForward(); rover.moveForward();
expect(rover.x, equals(0)); expect(rover.x, equals(0));
}); });
test('wraps around when moving South past boundary', () { test('wraps around when moving South past boundary', () {
final rover = Rover(x: 0, y: 0, direction: 'S', plateauWidth: 5, plateauHeight: 5); final rover = Rover(
x: 0,
y: 0,
direction: 'S',
plateauWidth: 5,
plateauHeight: 5,
);
rover.moveForward(); rover.moveForward();
expect(rover.y, equals(5)); expect(rover.y, equals(5));
}); });
test('wraps around when moving West past boundary', () { test('wraps around when moving West past boundary', () {
final rover = Rover(x: 0, y: 0, direction: 'W', plateauWidth: 5, plateauHeight: 5); final rover = Rover(
x: 0,
y: 0,
direction: 'W',
plateauWidth: 5,
plateauHeight: 5,
);
rover.moveForward(); rover.moveForward();
expect(rover.x, equals(5)); expect(rover.x, equals(5));
}); });
test('example with wrapping', () { test('example with wrapping', () {
final rover = Rover(x: 5, y: 5, direction: 'N', plateauWidth: 5, plateauHeight: 5); final rover = Rover(
x: 5,
y: 5,
direction: 'N',
plateauWidth: 5,
plateauHeight: 5,
);
rover.execute('MMM'); rover.execute('MMM');
expect(rover.y, equals(2)); expect(rover.y, equals(2));
}); });