1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-06-30 19:28:39 -04:00

Work around missing blank line after last header

Detect when a newline doesn't follow the last header when parsing SGML and break out of the header-parsing loop early. Add an example .qfx file demonstrating the broken behavior we're working around and a test.
This commit is contained in:
Martin Kobetic
2019-01-04 11:18:55 -05:00
committed by Aaron Lindsay
parent 7691881132
commit 0f6ceccd86
3 changed files with 71 additions and 2 deletions

View File

@ -140,10 +140,9 @@ func TestValidSamples(t *testing.T) {
fn := func(path string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
} else if filepath.Ext(path) != ".ofx" {
} else if ext := filepath.Ext(path); ext != ".ofx" && ext != ".qfx" {
return nil
}
file, err := os.Open(path)
if err != nil {
t.Fatalf("Unexpected error opening %s: %s\n", path, err)
@ -155,4 +154,5 @@ func TestValidSamples(t *testing.T) {
return nil
}
filepath.Walk("samples/valid_responses", fn)
filepath.Walk("samples/busted_responses", fn)
}