From ad8b7f97fa7c21fd690fd03bf794a5dff7b20188 Mon Sep 17 00:00:00 2001 From: Jean-Marc Meessen Date: Tue, 15 Mar 2022 18:01:47 +0100 Subject: [PATCH] Reproduce issue --- fleprocess/parse_line_test.go | 10 ++++++++++ fleprocess/validate_test.go | 5 +++++ test/data/fle-7-issue-78.txt | 10 ++++++++++ 3 files changed, 25 insertions(+) create mode 100644 test/data/fle-7-issue-78.txt diff --git a/fleprocess/parse_line_test.go b/fleprocess/parse_line_test.go index 7c6f012..dd96a08 100644 --- a/fleprocess/parse_line_test.go +++ b/fleprocess/parse_line_test.go @@ -153,6 +153,16 @@ func TestParseLine(t *testing.T) { args{inputStr: "1230 oe6cud/p oe/st-309", previousLine: LogLine{Mode: "FM", ModeType: "PHONE"}}, LogLine{Call: "OE6CUD/P", Time: "1230", ActualTime: "1230", RSTsent: "59", RSTrcvd: "59", Mode: "FM", ModeType: "PHONE", SOTA: "OE/ST-309"}, "", }, + { + "SOTA keywork (american SOTA ref)", + args{inputStr: "1230 oe6cud/p sota W7A/YV-102", previousLine: LogLine{Mode: "FM", ModeType: "PHONE"}}, + LogLine{Call: "OE6CUD/P", Time: "1230", ActualTime: "1230", RSTsent: "59", RSTrcvd: "59", Mode: "FM", ModeType: "PHONE", SOTA: "W7A/YV-102"}, "", + }, + { + "implied SOTA keywork (american SOTA ref)", + args{inputStr: "1230 oe6cud/p W7A/YV-102", previousLine: LogLine{Mode: "FM", ModeType: "PHONE"}}, + LogLine{Call: "OE6CUD/P", Time: "1230", ActualTime: "1230", RSTsent: "59", RSTrcvd: "59", Mode: "FM", ModeType: "PHONE", SOTA: "W7A/YV-102"}, "", + }, { "WWFF keywork ", args{inputStr: "1230 oe6cud/p wwff onff-0258", previousLine: LogLine{Mode: "FM", ModeType: "PHONE"}}, diff --git a/fleprocess/validate_test.go b/fleprocess/validate_test.go index b0b3c7e..22a39e9 100644 --- a/fleprocess/validate_test.go +++ b/fleprocess/validate_test.go @@ -152,6 +152,11 @@ func TestValidateSota(t *testing.T) { args{inputStr: "w4z/ON-001"}, "W4Z/ON-001", "", }, + { + "Good ref (american style) - Issue 78", + args{inputStr: "W7A/YV-102"}, + "W7A/YV-102", "", + }, { "Bad ref (long prefix)", args{inputStr: "xxxx/ON-001"}, diff --git a/test/data/fle-7-issue-78.txt b/test/data/fle-7-issue-78.txt new file mode 100644 index 0000000..7b3168c --- /dev/null +++ b/test/data/fle-7-issue-78.txt @@ -0,0 +1,10 @@ +mycall wu7h +mysota w7w/cw-064 +date 2022-03-12 +20m ssb +1730 K7EEX w0c/fr-058 +35 kg7azy w7a/yv-102 +37 12m cw na6mg w6/ct-262 +45 20m ssb w6wss w6/sd-108 +46 2m fm k7jro +1804 20m cw kr7rk w7a/cs-032 \ No newline at end of file