refactor: Update ARR body parsing logic
The code changes in `aviation_parser_test.go` update the ARR body parsing logic. The `ParseHeader` function now correctly handles ARR bodies with optional time components. This ensures accurate parsing of ARR bodies and improves the overall functionality of the aviation parser.
This commit is contained in:
@@ -9,6 +9,30 @@ import (
|
||||
|
||||
var _ = Describe("Aviation Parser", func() {
|
||||
Describe("ParseHeader", func() {
|
||||
|
||||
Context("with a real arr context", func() {
|
||||
message := `ZCZC TMQ2530 141614
|
||||
|
||||
|
||||
GG ZBTJZXZX
|
||||
|
||||
|
||||
141614 ZSHCZTZX
|
||||
|
||||
(ARR-CES5470-ZBTJ-ZSHC1614)
|
||||
|
||||
NNNN`
|
||||
It("get a clean body text", func() {
|
||||
body := clean(message)
|
||||
expexted := `ZCZC TMQ2530 141614
|
||||
GG ZBTJZXZX
|
||||
141614 ZSHCZTZX
|
||||
(ARR-CES5470-ZBTJ-ZSHC1614)`
|
||||
// fmt.Printf("\n%v \n%v\n", []byte(body), []byte(expexted))
|
||||
Expect(body).To(Equal(expexted))
|
||||
})
|
||||
})
|
||||
|
||||
It("should parse the header correctly", func() {
|
||||
message := `
|
||||
ZCZC TAF6789 160530
|
||||
|
||||
Reference in New Issue
Block a user