@@ -1020,6 +1020,47 @@ func TestParseEntryPoint(t *testing.T) {
1020
1020
assert .Check (t , is .DeepEqual ([]string (config .Entrypoint ), []string {"anything" }))
1021
1021
}
1022
1022
1023
+ func TestParseEntryPointSlice (t * testing.T ) {
1024
+ testCases := []struct {
1025
+ name string
1026
+ input string
1027
+ expected []string
1028
+ }{
1029
+ {
1030
+ name : "nothing" ,
1031
+ input : "" ,
1032
+ expected : nil ,
1033
+ },
1034
+ {
1035
+ name : "empty list" ,
1036
+ input : "--entrypoint=[]" ,
1037
+ expected : []string {},
1038
+ },
1039
+ {
1040
+ name : "empty string" ,
1041
+ input : "--entrypoint=" ,
1042
+ expected : []string {"" },
1043
+ },
1044
+ {
1045
+ name : "single" ,
1046
+ input : `--entrypoint=["something"]` ,
1047
+ expected : []string {"something" },
1048
+ },
1049
+ {
1050
+ name : "multiple" ,
1051
+ input : `--entrypoint=["sh","-c","echo foo bar"]` ,
1052
+ expected : []string {"sh" , "-c" , "echo foo bar" },
1053
+ },
1054
+ }
1055
+ for _ , tc := range testCases {
1056
+ t .Run (tc .name , func (t * testing.T ) {
1057
+ config , _ , _ , err := parseRun ([]string {tc .input })
1058
+ assert .NilError (t , err )
1059
+ assert .Check (t , is .DeepEqual ([]string (config .Entrypoint ), tc .expected ))
1060
+ })
1061
+ }
1062
+ }
1063
+
1023
1064
func TestValidateDevice (t * testing.T ) {
1024
1065
skip .If (t , runtime .GOOS != "linux" ) // Windows and macOS validate server-side
1025
1066
valid := []string {
0 commit comments