From e868f0f580fdf8af70bf4ba10b19790c5da6ae45 Mon Sep 17 00:00:00 2001 From: Lajos Papp Date: Mon, 17 Feb 2025 07:38:29 +0000 Subject: [PATCH] cli/command/container/opts_test: Fix entrypoint parsing logic Right now the test passes even if you change the expected value. It passes if the array has 1 element. Signed-off-by: Lajos Papp --- cli/command/container/opts_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cli/command/container/opts_test.go b/cli/command/container/opts_test.go index 720c9dfa04..c54f3107b6 100644 --- a/cli/command/container/opts_test.go +++ b/cli/command/container/opts_test.go @@ -1016,12 +1016,8 @@ func TestParseLabelfileVariables(t *testing.T) { func TestParseEntryPoint(t *testing.T) { config, _, _, err := parseRun([]string{"--entrypoint=anything", "cmd", "img"}) - if err != nil { - t.Fatal(err) - } - if len(config.Entrypoint) != 1 && config.Entrypoint[0] != "anything" { - t.Fatalf("Expected entrypoint 'anything', got %v", config.Entrypoint) - } + assert.NilError(t, err) + assert.Check(t, is.DeepEqual([]string(config.Entrypoint), []string{"anything"})) } func TestValidateDevice(t *testing.T) {