Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestUnmarshalWithoutNameType (0.4 sec)

  1. src/encoding/xml/read_test.go

    const withoutNameTypeData = `
    <?xml version="1.0" charset="utf-8"?>
    <Test3 Attr="OK" />`
    
    type TestThree struct {
    	XMLName Name   `xml:"Test3"`
    	Attr    string `xml:",attr"`
    }
    
    func TestUnmarshalWithoutNameType(t *testing.T) {
    	var x TestThree
    	if err := Unmarshal([]byte(withoutNameTypeData), &x); err != nil {
    		t.Fatalf("Unmarshal: %s", err)
    	}
    	if x.Attr != OK {
    		t.Fatalf("have %v\nwant %v", x.Attr, OK)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 29.1K bytes
    - Viewed (0)
Back to top