You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: version_set_test.go
    path of file: ./repos/dragonboat/internal/tan
    
    the code of the file until where you have to start completion: // Copyright 2012 The LevelDB-Go and Pebble Authors. All rights reserved. Use
// of this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
//
// Copyright 2017-2019 Lei Ni (nilei81@gmail.com) and other contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT W
    
func TestSwitchManifestFile(t *testing.T) {
	var vs versionSet
	var mu sync.Mutex
	dirname := "db-dir"
	fs := vfs.NewMem()
	defer vfs.ReportLeakedFD(fs, t)
	opt := &Options{MaxManifestFileSize: 1, FS: fs}
	require.NoError(t, fs.MkdirAll(dirname, 0700))
	dir, err := fs.OpenDir(dirname)
	require.NoError(t, err)
	defer dir.Close()
	require.NoError(t, vs.create(dirname, opt, dir, &mu))
	require.Equal(t, fileNum(1), vs.manifestFileNum)

	var ve1 versionEdit
	fn := vs.getNextFileNum()
	require.Equal(t, fileNum(2), fn)
	ve1.nextFileNum = fn + 1
	ve1.newFiles = append(ve1.newFiles, newFileEntry{
		meta: &fileMetadata{
			fileNum: fn,
		},
	})

	mu.Lock()
	vs.logLock()
	require.NoError(t, vs.logAndApply(&ve1, dir))
	mu.Unlock()

	require.Equal(t, fileNum(3), vs.manifestFileNum)
	require.Equal(t, 1, len(vs.obsoleteManifests))
	require.NoError(t, vs.close())
}