This commit is contained in:
PacoX
2026-05-13 08:49:24 +02:00
parent 6e2abfeb2d
commit ca02197414
11 changed files with 238 additions and 167 deletions
+9
View File
@@ -22,6 +22,15 @@ Contact _contact({
}
void main() {
test('splitPathBytes groups bytes by hash width', () {
final hops = PathHelper.splitPathBytes([0xA1, 0xA2, 0xC1, 0xC2], 2);
expect(hops, hasLength(2));
expect(hops.first, equals(Uint8List.fromList([0xA1, 0xA2])));
expect(hops.last, equals(Uint8List.fromList([0xC1, 0xC2])));
expect(PathHelper.formatHopHex(hops.first), equals('A1A2'));
});
test('resolvePathNames ignores chat nodes and keeps repeater/room nodes with 1-byte paths', () {
final contacts = [
_contact(firstByte: 0xF2, name: 'MunTui', type: advTypeChat),