Add comprehensive tests for DrawingMessageParser and SarMessageParser

- Implement critical string formatting tests for DrawingMessageParser, ensuring correct message creation, parsing, and validation.
- Validate JSON structure, coordinate formatting, and color index preservation in drawing messages.
- Introduce tests for various drawing types, including LineDrawing and RectangleDrawing, with emphasis on output consistency and error handling.
- Add tests for SarMessageParser, covering message creation, parsing, and format validation, including backward compatibility with old formats.
- Ensure proper handling of special characters, empty notes, and extreme coordinate values in SAR messages.
- Validate that messages conform to the CLAUDE.md specification and maintain compactness and efficiency.
This commit is contained in:
Janez T
2025-10-26 16:51:38 +01:00
parent cc4d666a94
commit 3a20b756fd
14 changed files with 1520 additions and 27 deletions

View File

@@ -440,7 +440,7 @@ class _MessagesTabState extends State<MessagesTab> {
// New format: S:<emoji>:<colorIndex>:<latitude>,<longitude>:<name>
// Round coordinates to 5 decimal places (~1m accuracy) since most GPS is only that accurate
final sarMessage =
'S:$emoji:$colorIndex:${position.latitude.toStringAsFixed(5)},${position.longitude.toStringAsFixed(5)}:$name';
'S:$emoji:${colorIndex.toString()}:${position.latitude.toStringAsFixed(5)},${position.longitude.toStringAsFixed(5)}:$name';
if (sendToChannel) {
// Create message ID