/*
Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/

package metadata_test

import (
	"fmt"
	"runtime"
	"testing"

	"github.com/hyperledger/fabric/common/tools/cryptogen/metadata"
	"github.com/stretchr/testify/assert"
)

func TestGetVersionInfo(t *testing.T) {
	testVersion := "TestVersion"
	metadata.Version = testVersion

	expected := fmt.Sprintf("%s:\n Version: %s\n Go version: %s\n OS/Arch: %s",
		metadata.ProgramName, testVersion, runtime.Version(),
		fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH))
	assert.Equal(t, expected, metadata.GetVersionInfo())
}

/*
Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/

package metadata_test

import (
	"fmt"
	"runtime"
	"testing"

	"github.com/hyperledger/fabric/common/tools/configtxlator/metadata"
	"github.com/stretchr/testify/assert"
)

func TestGetVersionInfo(t *testing.T) {
	testVersion := "TestVersion"
	metadata.Version = testVersion

	expected := fmt.Sprintf("%s:\n Version: %s\n Go version: %s\n OS/Arch: %s",
		metadata.ProgramName, testVersion, runtime.Version(),
		fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH))
	assert.Equal(t, expected, metadata.GetVersionInfo())
}

Fix incorrect package in configtxlator
[FAB-4897] Fix incorrect package in configtxlator

UT reports 0% coverage because the test codes use incorrect package in
common/tools/configtxlator/metadata. This CR fixes it.

Change-Id: Ica7e3b9d4c659a5dc3bf6ec5ab53b0f59fb5358f
Signed-off-by: Jun Nemoto <0f36410cf31719a35aea513fdc960060bbf0aad2@hitachi.com>
Signed-off-by: Nao Nishijima <ba12c351dbe96870a968dc0b0668a4a809432a94@hal.hitachi.com>
