Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests are failing #4

Open
tyliec opened this issue Nov 7, 2023 · 3 comments
Open

Tests are failing #4

tyliec opened this issue Nov 7, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@tyliec
Copy link

tyliec commented Nov 7, 2023

On an initial clone, running make test seems to be failing:

The specific test failing seems to be TestReadStringInto

Example Test Run:

Click to expand
go test ./...
--- FAIL: TestReadStringInto (0.00s)
    read_test.go:312: scanning:0 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:1 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:"value"}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:2 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:3 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:" ", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:4 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:5 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:" value ", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:6 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"va ; lue", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:7 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"val ue", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:320: scanning:8 pass: got error 2:6: string not terminated
    read_test.go:312: scanning:9 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"va\\lue", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:10 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"va\"lue", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:11 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"va\nlue", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:12 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"va\tlue", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:13 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"x:\\path\\", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:14 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"\b", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:320: scanning:15 pass: got error 3:7: unknown escape sequence
    read_test.go:320: scanning:16 pass: got error 3:7: unknown escape sequence
    read_test.go:320: scanning:17 pass: got error 3:11: unknown escape sequence
    read_test.go:320: scanning:18 pass: got error 3:10: unknown escape sequence
    read_test.go:316: scanning:19 fail: got value &gcfg.cSubs{Sub:map[string]*gcfg.cSubsS1{"A\n":(*gcfg.cSubsS1)(0x1400019e4c0)}}, wanted error
    read_test.go:320: scanning:20 pass: got error 2:9: unknown escape sequence
    read_test.go:308: scanning:21 fail: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value \n value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}, wanted value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value  value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:316: scanning:22 fail: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value \n value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}, wanted error
    read_test.go:312: scanning:whitespace:0 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:1 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:2 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:3 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:4 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:5 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:6 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:7 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:8 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:9 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:10 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:11 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:12 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:13 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:14 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:15 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:16 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:17 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:18 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:whitespace:19 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:0 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:1 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:2 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:3 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:4 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:5 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:6 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:7 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:8 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:9 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:10 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"va ; lue", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:comments:11 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: scanning:subsections:0 pass: got value &gcfg.cSubs{Sub:map[string]*gcfg.cSubsS1{"A":(*gcfg.cSubsS1)(0x14000218290)}}
    read_test.go:312: scanning:subsections:1 pass: got value &gcfg.cSubs{Sub:map[string]*gcfg.cSubsS1{"b":(*gcfg.cSubsS1)(0x14000218470)}}
    read_test.go:312: scanning:subsections:2 pass: got value &gcfg.cSubs{Sub:map[string]*gcfg.cSubsS1{"A\\":(*gcfg.cSubsS1)(0x14000218650)}}
    read_test.go:312: scanning:subsections:3 pass: got value &gcfg.cSubs{Sub:map[string]*gcfg.cSubsS1{"A\"":(*gcfg.cSubsS1)(0x14000218830)}}
    read_test.go:320: syntax:0 pass: got error 3:1: expected section header or variable declaration
    read_test.go:320: syntax:1 pass: got error 1:1: expected section header
    read_test.go:320: syntax:2 pass: got error 2:2: expected section name
    read_test.go:320: syntax:3 pass: got error 2:6: empty subsection name
    read_test.go:312: setting:0 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: setting:1 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: setting:2 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(0x140002190c0)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: setting:3 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string(nil)}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(nil)}}
    read_test.go:312: setting:4 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string(nil)}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(0x1400010f320)}}
    read_test.go:312: setting:5 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string(nil)}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(0x1400010f3c8)}}
    read_test.go:312: setting:6 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string(nil)}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(0x1400010f488)}}
    read_test.go:320: setting:7 pass: got error warnings:
        can't store data at section "nonexistent"
        can't store data at section "nonexistent"
        can't store data at section "nonexistent"
        can't store data at section "nonexistent"
    read_test.go:320: setting:8 pass: got error warnings:
        can't store data at section "section", subsection "nonexistent"
        can't store data at section "section", subsection "nonexistent"
    read_test.go:320: setting:9 pass: got error warning:
        can't store data at section "section", variable "nonexistent"
    read_test.go:312: setting:10 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:"value"}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:320: setting:11 pass: got error warnings:
        can't store data at section "unexported"
        can't store data at section "unexported"
        can't store data at section "unexported"
        can't store data at section "unexported"
    read_test.go:320: setting:12 pass: got error warning:
        can't store data at section "exported", variable "unexported"
    read_test.go:312: setting:13 pass: got value &gcfg.cUni{X甲:gcfg.cUniS1{X乙:"丙"}, XSection:gcfg.cUniS2{XName:""}}
    read_test.go:312: setting:14 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}}
    read_test.go:312: setting:15 pass: got value &gcfg.cSubs{Sub:map[string]*gcfg.cSubsS1{"A":(*gcfg.cSubsS1)(0x14000230d20), "B":(*gcfg.cSubsS1)(0x14000230d90)}}
    read_test.go:312: multivalue:0 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string(nil)}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(nil)}}
    read_test.go:312: multivalue:1 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string{"value"}}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(nil)}}
    read_test.go:312: multivalue:2 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string{"value1", "value2"}}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(nil)}}
    read_test.go:312: multivalue:3 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string{"value1", "value2"}}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(nil)}}
    read_test.go:312: multivalue:4 pass: got value &gcfg.cMulti{M1:gcfg.cMultiS1{Multi:[]string(nil)}, M2:gcfg.cMultiS2{NonMulti:gcfg.nonMulti(nil)}, M3:gcfg.cMultiS3{PMulti:(*[]string)(nil)}}
    read_test.go:320: multivalue:5 pass: got error warning:
        can't store data at section "m2", variable "multi"
    read_test.go:320: multivalue:6 pass: got error warnings:
        can't store data at section "m2", variable "multi"
        can't store data at section "m2", variable "multi"
    read_test.go:312: type:string:0 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"value", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: type:string:1 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: type:bool:0 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:true}}
    read_test.go:312: type:bool:1 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:true}}
    read_test.go:312: type:bool:2 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:true}}
    read_test.go:312: type:bool:3 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:true}}
    read_test.go:312: type:bool:4 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:true}}
    read_test.go:312: type:bool:5 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:false}}
    read_test.go:312: type:bool:6 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:false}}
    read_test.go:312: type:bool:7 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:false}}
    read_test.go:312: type:bool:8 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:false}}
    read_test.go:312: type:bool:9 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:false}}
    read_test.go:312: type:bool:10 pass: got value &gcfg.cBool{Section:gcfg.cBoolS1{Bool:true}}
    read_test.go:320: type:bool:11 pass: got error failed to parse bool `maybe`
    read_test.go:320: type:bool:12 pass: got error failed to parse bool `t`
    read_test.go:320: type:bool:13 pass: got error failed to parse bool `truer`
    read_test.go:320: type:bool:14 pass: got error failed to parse bool `2`
    read_test.go:320: type:bool:15 pass: got error failed to parse bool `-1`
    read_test.go:312: type:numeric:0 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: type:numeric:1 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:1, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:312: type:numeric:2 pass: got value &gcfg.cBasic{Section:gcfg.cBasicS1{Name:"", Int:-1, PName:(*string)(nil)}, Hyphen_In_Section:gcfg.cBasicS2{Hyphen_In_Name:""}, unexported:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}, Exported:gcfg.cBasicS3{unexported:""}, TagName:gcfg.cBasicS1{Name:"", Int:0, PName:(*string)(nil)}}
    read_test.go:320: type:numeric:3 pass: got error failed to parse "0.2" as int: extra characters ".2"
    read_test.go:320: type:numeric:4 pass: got error failed to parse "1e3" as int: extra characters "e3"
    read_test.go:312: type:numeric:5 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:10, IntDHO:0, Big:<nil>}, N2:gcfg.cNumS2{MultiInt:[]int(nil), MultiBig:[]*big.Int(nil)}, N3:gcfg.cNumS3{FileMode:0x0}}
    read_test.go:312: type:numeric:6 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:16, IntDHO:0, Big:<nil>}, N2:gcfg.cNumS2{MultiInt:[]int(nil), MultiBig:[]*big.Int(nil)}, N3:gcfg.cNumS3{FileMode:0x0}}
    read_test.go:312: type:numeric:7 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:0, IntDHO:0, Big:1}, N2:gcfg.cNumS2{MultiInt:[]int(nil), MultiBig:[]*big.Int(nil)}, N3:gcfg.cNumS3{FileMode:0x0}}
    read_test.go:312: type:numeric:8 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:0, IntDHO:0, Big:16}, N2:gcfg.cNumS2{MultiInt:[]int(nil), MultiBig:[]*big.Int(nil)}, N3:gcfg.cNumS3{FileMode:0x0}}
    read_test.go:312: type:numeric:9 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:0, IntDHO:0, Big:10}, N2:gcfg.cNumS2{MultiInt:[]int(nil), MultiBig:[]*big.Int(nil)}, N3:gcfg.cNumS3{FileMode:0x0}}
    read_test.go:312: type:numeric:10 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:0, IntDHO:0, Big:<nil>}, N2:gcfg.cNumS2{MultiInt:[]int{10}, MultiBig:[]*big.Int(nil)}, N3:gcfg.cNumS3{FileMode:0x0}}
    read_test.go:312: type:numeric:11 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:0, IntDHO:0, Big:<nil>}, N2:gcfg.cNumS2{MultiInt:[]int(nil), MultiBig:[]*big.Int{10}}, N3:gcfg.cNumS3{FileMode:0x0}}
    read_test.go:312: type:numeric:12 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:0, IntDHO:8, Big:<nil>}, N2:gcfg.cNumS2{MultiInt:[]int(nil), MultiBig:[]*big.Int(nil)}, N3:gcfg.cNumS3{FileMode:0x0}}
    read_test.go:312: type:numeric:13 pass: got value &gcfg.cNum{N1:gcfg.cNumS1{Int:0, IntDHO:0, Big:<nil>}, N2:gcfg.cNumS2{MultiInt:[]int(nil), MultiBig:[]*big.Int(nil)}, N3:gcfg.cNumS3{FileMode:0x1ff}}
    read_test.go:312: type:textUnmarshaler:0 pass: got value &gcfg.cTxUnm{Section:gcfg.cTxUnmS1{Name:"value"}}
    read_test.go:320: type:textUnmarshaler:1 pass: got error error
FAIL
FAIL	github.com/go-git/gcfg	0.200s
ok  	github.com/go-git/gcfg/scanner	0.553s
ok  	github.com/go-git/gcfg/token	0.384s
ok  	github.com/go-git/gcfg/types	0.733s
FAIL
make: *** [test] Error 1

@tyliec
Copy link
Author

tyliec commented Nov 7, 2023

This readtest is broken in particular:

	{"scanning", []readtest{
		{"[section]\nname=value", &cBasic{Section: cBasicS1{Name: "value"}}, true},
		// hyphen in name
		{"[hyphen-in-section]\nhyphen-in-name=value", &cBasic{Hyphen_In_Section: cBasicS2{Hyphen_In_Name: "value"}}, true},
		// quoted string value
		{"[section]\nname=\"\"", &cBasic{Section: cBasicS1{Name: ""}}, true},
		{"[section]\nname=\" \"", &cBasic{Section: cBasicS1{Name: " "}}, true},
		{"[section]\nname=\"value\"", &cBasic{Section: cBasicS1{Name: "value"}}, true},
		{"[section]\nname=\" value \"", &cBasic{Section: cBasicS1{Name: " value "}}, true},
		{"\n[section]\nname=\"va ; lue\"", &cBasic{Section: cBasicS1{Name: "va ; lue"}}, true},
		{"[section]\nname=\"val\" \"ue\"", &cBasic{Section: cBasicS1{Name: "val ue"}}, true},
		{"[section]\nname=\"value", &cBasic{}, false},
		// escape sequences
		{"[section]\nname=\"va\\\\lue\"", &cBasic{Section: cBasicS1{Name: "va\\lue"}}, true},
		{"[section]\nname=\"va\\\"lue\"", &cBasic{Section: cBasicS1{Name: "va\"lue"}}, true},
		{"[section]\nname=\"va\\nlue\"", &cBasic{Section: cBasicS1{Name: "va\nlue"}}, true},
		{"[section]\nname=\"va\\tlue\"", &cBasic{Section: cBasicS1{Name: "va\tlue"}}, true},
		{"[section]\nname=x:\\\\path\\\\", &cBasic{Section: cBasicS1{Name: "x:\\path\\"}}, true},
		{"[section]\nname=\\b", &cBasic{Section: cBasicS1{Name: "\b"}}, true},
		{"\n[section]\nname=\\", &cBasic{}, false},
		{"\n[section]\nname=\\a", &cBasic{}, false},
		{"\n[section]\nname=\"val\\a\"", &cBasic{}, false},
		{"\n[section]\nname=val\\", &cBasic{}, false},
		{"\n[sub \"A\\\n\"]\nname=value", &cSubs{}, false},
		{"\n[sub \"A\\\t\"]\nname=value", &cSubs{}, false},
		// broken line
		{"[section]\nname=value \\\n value", &cBasic{Section: cBasicS1{Name: "value  value"}}, true},
		{"[section]\nname=\"value \\\n value\"", &cBasic{}, false},
	}},

@tyliec
Copy link
Author

tyliec commented Nov 7, 2023

These specific lines:

{"\n[sub \"A\\\n\"]\nname=value", &cSubs{}, false},

{"[section]\nname=value \\\n value", &cBasic{Section: cBasicS1{Name: "value  value"}}, true},

{"[section]\nname=\"value \\\n value\"", &cBasic{}, false},

@pjbgf pjbgf added the bug Something isn't working label Nov 9, 2023
@pjbgf
Copy link
Member

pjbgf commented Nov 9, 2023

@tyliec thank you for pointing it out. Wouild you be keen on submitting a PR with a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants