github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/pkg/machine/qemu/machine_test.go (about)

     1  package qemu
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/require"
     7  )
     8  
     9  func TestEditCmd(t *testing.T) {
    10  	vm := new(MachineVM)
    11  	vm.CmdLine = []string{"command", "-flag", "value"}
    12  
    13  	vm.editCmdLine("-flag", "newvalue")
    14  	vm.editCmdLine("-anotherflag", "anothervalue")
    15  
    16  	require.Equal(t, vm.CmdLine, []string{"command", "-flag", "newvalue", "-anotherflag", "anothervalue"})
    17  }