github.com/iotexproject/iotex-core@v1.14.1-rc1/testutil/file_test.go (about)

     1  // Copyright (c) 2021 IoTeX
     2  // This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability
     3  // or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed.
     4  // This source code is governed by Apache License 2.0 that can be found in the LICENSE file.
     5  
     6  package testutil
     7  
     8  import (
     9  	"os"
    10  	"testing"
    11  
    12  	"github.com/stretchr/testify/assert"
    13  )
    14  
    15  func TestFile(t *testing.T) {
    16  	assert := assert.New(t)
    17  	tmpPath, err := PathOfTempFile("iotx")
    18  	assert.NoError(err)
    19  	_, err = os.Stat(tmpPath)
    20  	assert.NoError(err)
    21  	defer CleanupPath(tmpPath)
    22  }