github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/libkbfs/md_id_journal_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 "github.com/keybase/client/go/kbfs/kbfsmd" 12 "github.com/keybase/go-codec/codec" 13 ) 14 15 type mdIDJournalEntryFuture struct { 16 mdIDJournalEntry 17 kbfscodec.Extra 18 } 19 20 func (ef mdIDJournalEntryFuture) toCurrent() mdIDJournalEntry { 21 return ef.mdIDJournalEntry 22 } 23 24 func (ef mdIDJournalEntryFuture) ToCurrentStruct() kbfscodec.CurrentStruct { 25 return ef.toCurrent() 26 } 27 28 func makeFakeMDIDJournalEntryFuture(t *testing.T) mdIDJournalEntryFuture { 29 ef := mdIDJournalEntryFuture{ 30 mdIDJournalEntry{ 31 kbfsmd.FakeID(1), 32 false, false, false, 33 codec.UnknownFieldSetHandler{}, 34 }, 35 kbfscodec.MakeExtraOrBust("mdIDJournalEntry", t), 36 } 37 return ef 38 } 39 40 func TestMDIDJournalEntryUnknownFields(t *testing.T) { 41 testStructUnknownFields(t, makeFakeMDIDJournalEntryFuture(t)) 42 }