Files
podman/libpod/runtime_test.go
Kir Kolyshkin 49cce3ec16 libpod: modernize state test
Use t.Helper, t.TempDir, and t.Cleanup in getEmptySqliteState,
simplifying its code and its users.

Simplify runForAllStates: remove redundant t.Fail call, and move
getEmptySqliteState call under t.Run.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-07 12:11:47 -08:00

24 lines
377 B
Go

//go:build !remote
package libpod
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_generateName(t *testing.T) {
state, _ := getEmptySqliteState(t)
r := &Runtime{
state: state,
}
// Test that (*Runtime).generateName returns different names
// if called twice.
n1, _ := r.generateName()
n2, _ := r.generateName()
assert.NotEqual(t, n1, n2)
}