Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for TestNullString (0.19 sec)

  1. src/database/sql/convert_test.go

    		}
    		if len(ct.wantusrstr) != 0 && ct.wantusrstr != *ct.d.(*userDefinedString) {
    			errf("want userDefined %q, got %q", ct.wantusrstr, *ct.d.(*userDefinedString))
    		}
    	}
    }
    
    func TestNullString(t *testing.T) {
    	var ns NullString
    	convertAssign(&ns, []byte("foo"))
    	if !ns.Valid {
    		t.Errorf("expecting not null")
    	}
    	if ns.String != "foo" {
    		t.Errorf("expecting foo; got %q", ns.String)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 10 20:23:22 UTC 2024
    - 17K bytes
    - Viewed (0)
  2. src/encoding/json/decode_test.go

    	}
    }
    
    // Test that a null for ,string is not replaced with the previous quoted string (issue 7046).
    // It should also not be an error (issue 2540, issue 8587).
    func TestNullString(t *testing.T) {
    	type T struct {
    		A int  `json:",string"`
    		B int  `json:",string"`
    		C *int `json:",string"`
    	}
    	data := []byte(`{"A": "1", "B": null, "C": null}`)
    	var s T
    	s.B = 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:40:14 UTC 2024
    - 67.6K bytes
    - Viewed (0)
Back to top