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: stat_test.go
    path of file: ./repos/wazero/internal/sysfs
    
    the code of the file until where you have to start completion: package sysfs

import (
	"os"
	"path"
	"runtime"
	"testing"
	"time"

	experimentalsys "github.com/tetratelabs/wazero/experimental/sys"
	"github.com/tetratelabs/wazero/internal/testing/require"
	"github.com/tetratelabs/wazero/sys"
)

func TestStat(t *testing.T) {
	tmpDir := t.TempDir()

	_, errno := stat(path.Join(tmpDir, "cat"))
	require.EqualErrno(t, experimentalsys.ENOENT, errno)
	_, errno = stat(path.Join(tmpDir, "sub/cat"))
	require.EqualErrno(t, experimentalsys.ENOENT, errno)

	var st sys.Stat_t

	t.Run("empty dir", func(t *testing.T) {
		st, errno = stat(tmpDir)
		require.EqualErrno(t, 0, errno)

		require.True(t, st.Mode.IsDir())
		require.NotEqual(t, uint64(0), s
    
func TestStatFile_dev_inode(t *testing.T) {
	tmpDir := t.TempDir()
	d := requireOpenFile(t, tmpDir, experimentalsys.O_RDONLY, 0)
	defer d.Close()

	path1 := path.Join(tmpDir, "1")
	f1 := requireOpenFile(t, path1, experimentalsys.O_CREAT, 0o666)
	defer f1.Close()

	path2 := path.Join(tmpDir, "2")
	f2 := requireOpenFile(t, path2, experimentalsys.O_CREAT, 0o666)
	defer f2.Close()

	pathLink2 := path.Join(tmpDir, "link2")
	err := os.Symlink(path2, pathLink2)
	require.NoError(t, err)
	l2 := requireOpenFile(t, pathLink2, experimentalsys.O_RDONLY, 0)
	defer l2.Close()

	// First, stat the directory
	st1, errno := d.Stat()
	require.EqualErrno(t, 0, errno)
	requireDir(t, d, st1)
	requireDevIno(t, d, st1)

	// Now, stat the files in it
	st1, errno = f1.Stat()
	require.EqualErrno(t, 0, errno)
	requireNotDir(t, f1, st1)
	requireDevIno(t, f1, st1)

	st2, errno := f2.Stat()
	require.EqualErrno(t, 0, errno)
	requireNotDir(t, f2, st2)
	requireDevIno(t, f2, st2)

	st3, errno := l2.Stat()
	require.EqualErrno(t, 0, errno)
	requireNotDir(t, l2, st3)
	requireDevIno(t, l2, st3)

	// The files should be on the same device, but different inodes
	require.Equal(t, st1.Dev, st2.Dev)
	require.NotEqual(t, st1.Ino, st2.Ino)
	require.Equal(t, st2, st3) // stat on a link is for its target

	// Redoing stat should result in the same inodes
	st1Again, errno := f1.Stat()
	require.EqualErrno(t, 0, errno)
	require.Equal(t, st1.Dev, st1Again.Dev)

	// On Windows, we cannot rename while opening.
	// So we manually close here before renaming.
	require.EqualErrno(t, 0, f1.Close())
	require.EqualErrno(t, 0, f2.Close())
	require.EqualErrno(t, 0, l2.Close())

	// Renaming a file shouldn't change its inodes.
	require.EqualErrno(t, 0, rename(path1, path2))
	f1 = requireOpenFile(t, path2, experimentalsys.O_RDONLY, 0)
	defer f1.Close()

	st1Again, errno = f1.Stat()
	require.EqualErrno(t, 0, errno)
	require.Equal(t, st1.Dev, st1Again.Dev)
	require.Equal(t, st1.Ino, st1Again.Ino)
}