github.com/inklabsfoundation/inkchain@v0.17.1-0.20181025012015-c3cef8062f19/common/tools/configtxlator/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 "github.com/inklabsfoundation/inkchain/common/tools/configtxlator/metadata" 15 "github.com/stretchr/testify/assert" 16 ) 17 18 func TestGetVersionInfo(t *testing.T) { 19 testVersion := "TestVersion" 20 metadata.Version = testVersion 21 22 expected := fmt.Sprintf("%s:\n Version: %s\n Go version: %s\n OS/Arch: %s", 23 metadata.ProgramName, testVersion, runtime.Version(), 24 fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)) 25 assert.Equal(t, expected, metadata.GetVersionInfo()) 26 }