22 lines
731 B
Go
22 lines
731 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestFormatAFDMarkdown(t *testing.T) {
|
|
input := "Area Forecast Discussion\n\n.SHORT TERM /Tonight/...\nText\n&&\n.LONG TERM /Friday/...\nMore"
|
|
out := formatAFDMarkdown(input)
|
|
expected := "# Area Forecast Discussion\n\n# Short Term /Tonight/\nText\n# Long Term /Friday/\nMore"
|
|
if out != expected {
|
|
t.Fatalf("unexpected markdown output:\n%s", out)
|
|
}
|
|
}
|
|
|
|
func TestFormatAFDMarkdownKeyMessage(t *testing.T) {
|
|
input := "Area Forecast Discussion\nKey Message 1...Heavy rain possible\nDetails"
|
|
out := formatAFDMarkdown(input)
|
|
expected := "# Area Forecast Discussion\n## Key Message 1\nHeavy rain possible\nDetails"
|
|
if out != expected {
|
|
t.Fatalf("unexpected markdown output:\n%s", out)
|
|
}
|
|
}
|