github.com/anjalikarhana/fabric@v2.1.1+incompatible/orderer/common/metadata/metadata_test.go (about) 1 /* 2 Copyright IBM Corp. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package metadata_test 8 9 import ( 10 "fmt" 11 "runtime" 12 "testing" 13 14 common "github.com/hyperledger/fabric/common/metadata" 15 "github.com/hyperledger/fabric/orderer/common/metadata" 16 "github.com/stretchr/testify/assert" 17 ) 18 19 func TestGetVersionInfo(t *testing.T) { 20 expected := fmt.Sprintf( 21 "%s:\n Version: %s\n Commit SHA: %s\n Go version: %s\n OS/Arch: %s\n", 22 metadata.ProgramName, common.Version, 23 common.CommitSHA, 24 runtime.Version(), 25 fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), 26 ) 27 assert.Equal(t, expected, metadata.GetVersionInfo()) 28 }