Refactored extras field parsing
This commit is contained in:
@@ -110,7 +110,7 @@ describe("APRS extras test vectors", () => {
|
||||
const commentSeg = structure.find((s) => /comment/i.test(String(s.name))) as Segment | undefined;
|
||||
expect(commentSeg).toBeDefined();
|
||||
const fieldsRNG = (commentSeg!.fields ?? []) as Field[];
|
||||
const hasRNG = fieldsRNG.some((f) => f.name === "RNG marker");
|
||||
const hasRNG = fieldsRNG.some((f) => f.name === "range marker");
|
||||
expect(hasRNG).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -950,7 +950,7 @@ describe("Packet dissection with sections", () => {
|
||||
const commentSection = result.structure?.find((s) => s.name === "comment");
|
||||
expect(commentSection).toBeDefined();
|
||||
expect(commentSection?.data?.byteLength).toBe("Test message".length);
|
||||
expect(commentSection?.fields?.[0]?.name).toBe("text");
|
||||
expect(commentSection?.fields?.[0]?.name).toBe("comment");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user