github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/libkbfs/unknown_fields_test.go (about)

     1  // Copyright 2016 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  
     5  package libkbfs
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/keybase/client/go/kbfs/kbfscodec"
    11  )
    12  
    13  // testStructUnknownFields calls TestStructUnknownFields with codecs
    14  // with extensions registered.
    15  func testStructUnknownFields(t *testing.T, sFuture kbfscodec.FutureStruct) {
    16  	cFuture := kbfscodec.NewMsgpack()
    17  	registerOpsFuture(cFuture)
    18  
    19  	cCurrent := kbfscodec.NewMsgpack()
    20  	RegisterOps(cCurrent)
    21  
    22  	cCurrentKnownOnly := kbfscodec.NewMsgpackNoUnknownFields()
    23  	RegisterOps(cCurrentKnownOnly)
    24  
    25  	kbfscodec.TestStructUnknownFields(
    26  		t, cFuture, cCurrent, cCurrentKnownOnly, sFuture)
    27  }