mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-11-29 09:11:17 +01:00
The round button label kept only the first letter of each word, so every
generic gamepad button ("button-7") read "B" and every axis ("axis-1_-1")
read "A". Show "B7", "A1+" and "A1−" instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1007 B
Dart
25 lines
1007 B
Dart
import 'package:bike_control/utils/keymap/buttons.dart';
|
||
import 'package:flutter_test/flutter_test.dart';
|
||
|
||
void main() {
|
||
group('ControllerButton.initials', () {
|
||
test('multi-word camelCase → first letters, directions as arrows', () {
|
||
expect(const ControllerButton('sideButtonLeft').initials, 'SB←');
|
||
expect(const ControllerButton('navigationUp').initials, 'N↑');
|
||
expect(const ControllerButton('shiftDownRight').initials, 'S↓→');
|
||
});
|
||
|
||
test('single-word name → single uppercase letter', () {
|
||
expect(const ControllerButton('a').initials, 'A');
|
||
expect(const ControllerButton('paddleLeft').initials, 'P←');
|
||
});
|
||
|
||
test('generic gamepad keys keep their number', () {
|
||
expect(const ControllerButton('button-7').initials, 'B7');
|
||
expect(const ControllerButton('button-12').initials, 'B12');
|
||
expect(const ControllerButton('axis-1_1').initials, 'A1+');
|
||
expect(const ControllerButton('axis-1_-1').initials, 'A1−');
|
||
});
|
||
});
|
||
}
|