MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestWithNullPropertyKey

Function TestWithNullPropertyKey

db/database_test.go:2637–2651  ·  view source on GitHub ↗

Unit test for issue #976

(t *testing.T)

Source from the content-addressed store, hash-verified

2635
2636// Unit test for issue #976
2637func TestWithNullPropertyKey(t *testing.T) {
2638
2639 db, ctx := setupTestDB(t)
2640 defer db.Close(ctx)
2641 collection, ctx := GetSingleDatabaseCollectionWithUser(ctx, t, db)
2642
2643 // Test creating a document with null property key
2644 customDocId := "customIdValue"
2645 log.Printf("Create document with empty property key")
2646 body := Body{BodyId: customDocId, "": "value1"}
2647 docid, rev1id, _, err := collection.Post(ctx, body)
2648 require.NoError(t, err)
2649 assert.True(t, rev1id != "")
2650 assert.True(t, docid != "")
2651}
2652
2653// Unit test for issue #507, modified for CBG-1995 (allowing special properties)
2654func TestPostWithUserSpecialProperty(t *testing.T) {

Callers

nothing calls this directly

Calls 4

setupTestDBFunction · 0.85
PostMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected