(t *testing.T)
| 2888 | } |
| 2889 | |
| 2890 | func TestNullDocHandlingForMutable1xBody(t *testing.T) { |
| 2891 | rt := NewRestTester(t, nil) |
| 2892 | defer rt.Close() |
| 2893 | collection, ctx := rt.GetSingleTestDatabaseCollectionWithUser() |
| 2894 | |
| 2895 | documentRev := db.DocumentRevision{DocID: "doc1", BodyBytes: []byte("null")} |
| 2896 | |
| 2897 | body, err := documentRev.Mutable1xBody(ctx, collection, nil, nil, false, false) |
| 2898 | require.Error(t, err) |
| 2899 | require.Nil(t, body) |
| 2900 | assert.Contains(t, err.Error(), "null doc body for doc") |
| 2901 | |
| 2902 | bodyBytes, err := documentRev.Inject1xBodyProperties(rt.Context(), collection, nil, nil, false) |
| 2903 | require.Error(t, err) |
| 2904 | require.Nil(t, bodyBytes) |
| 2905 | assert.Contains(t, err.Error(), "b is not a JSON object") |
| 2906 | } |
| 2907 | |
| 2908 | // TestDatabaseXattrConfigHandlingForDBConfigUpdate: |
| 2909 | // - Create database with xattrs enabled |
nothing calls this directly
no test coverage detected