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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user