MCPcopy
hub / github.com/hashicorp/packer / TestBuildCommand_HCLOnlyExceptOptions

Function TestBuildCommand_HCLOnlyExceptOptions

command/build_test.go:904–972  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

902}
903
904func TestBuildCommand_HCLOnlyExceptOptions(t *testing.T) {
905 tests := []struct {
906 args []string
907 present []string
908 notPresent []string
909 expectReturn int
910 }{
911 {
912 []string{"-only=chocolate"},
913 []string{},
914 []string{"chocolate.txt", "vanilla.txt", "cherry.txt"},
915 1,
916 },
917 {
918 []string{"-only=*chocolate*"},
919 []string{"chocolate.txt"},
920 []string{"vanilla.txt", "cherry.txt"},
921 0,
922 },
923 {
924 []string{"-except=*chocolate*"},
925 []string{"vanilla.txt", "cherry.txt"},
926 []string{"chocolate.txt"},
927 0,
928 },
929 {
930 []string{"-except=*ch*"},
931 []string{"vanilla.txt"},
932 []string{"chocolate.txt", "cherry.txt"},
933 0,
934 },
935 {
936 []string{"-only=*chocolate*", "-only=*vanilla*"},
937 []string{"chocolate.txt", "vanilla.txt"},
938 []string{"cherry.txt"},
939 0,
940 },
941 {
942 []string{"-except=*chocolate*", "-except=*vanilla*"},
943 []string{"cherry.txt"},
944 []string{"chocolate.txt", "vanilla.txt"},
945 0,
946 },
947 {
948 []string{"-only=my_build.file.chocolate"},
949 []string{"chocolate.txt"},
950 []string{"vanilla.txt", "cherry.txt"},
951 0,
952 },
953 {
954 []string{"-except=my_build.file.chocolate"},
955 []string{"vanilla.txt", "cherry.txt"},
956 []string{"chocolate.txt"},
957 0,
958 },
959 {
960 []string{"-only=file.cherry"},
961 []string{"cherry.txt"},

Callers

nothing calls this directly

Calls 2

testHCLOnlyExceptFlagsFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…