Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xh3b4sd committed Oct 8, 2024
1 parent 4dc6574 commit b9dcece
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 15 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ go 1.22
require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/prometheus/client_golang v1.20.3
github.com/prometheus/client_golang v1.20.4
github.com/xh3b4sd/breakr v0.1.0
github.com/xh3b4sd/logger v0.8.1
github.com/xh3b4sd/redigo v0.37.2
github.com/xh3b4sd/redigo v0.38.0
github.com/xh3b4sd/tracer v0.11.1
)

Expand All @@ -22,10 +22,10 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.59.1 // indirect
github.com/prometheus/common v0.60.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
golang.org/x/sys v0.25.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
golang.org/x/sys v0.26.0 // indirect
google.golang.org/protobuf v1.35.1 // indirect
)

retract [v0.0.0, v0.14.0]
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4=
github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0=
github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0=
github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA=
github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/rafaeljusto/redigomock v2.4.0+incompatible h1:d7uo5MVINMxnRr20MxbgDkmZ8QRfevjOVgEa4n0OZyY=
Expand All @@ -55,15 +55,15 @@ github.com/xh3b4sd/breakr v0.1.0 h1:ZdQPaocCc2ac4ipEdc3eaq1M0zeg54s1kC7QZQn3TLI=
github.com/xh3b4sd/breakr v0.1.0/go.mod h1:dhU5gRl07UxonMdO6KzoGKLN545cWXPd3viKzw2bPPY=
github.com/xh3b4sd/logger v0.8.1 h1:faI/W2c6tg1ah2Mp/c4/hY8B/94SL3nnUs7jNITyUgI=
github.com/xh3b4sd/logger v0.8.1/go.mod h1:fPOPU7+b3NX+elW7raMDCYbRHJIjKToQR3icsHNSHB0=
github.com/xh3b4sd/redigo v0.37.2 h1:EBRmi+kd7uN5Xv1AEr6P4Wzu+Fh1/BUC2ndyx8b+60I=
github.com/xh3b4sd/redigo v0.37.2/go.mod h1:oZ+QmnabHOKkpEev5kWW3ZkxnNVEujllGko4GYPTw5k=
github.com/xh3b4sd/redigo v0.38.0 h1:MZD1U1p8nvL4TLeFa/eFGW3SDBdJHwDA7hcD/6/WRkM=
github.com/xh3b4sd/redigo v0.38.0/go.mod h1:oZ+QmnabHOKkpEev5kWW3ZkxnNVEujllGko4GYPTw5k=
github.com/xh3b4sd/tracer v0.11.1 h1:66G8yNkUkyuTRQ586cQMKrBxrD4mQej8mpR9PYoIiGg=
github.com/xh3b4sd/tracer v0.11.1/go.mod h1:vrAkiLN6hl3VdUeLo71mvqCgUw2TE0YyvzrORa/vHXs=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
27 changes: 27 additions & 0 deletions matcher/has_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,33 @@ func Test_Task_Has(t *testing.T) {
},
has: true,
},
// Case 024
{
all: map[string]string{
"key": "val",
"one": "two",
"baz": "zap",
},
sub: map[string]string{
"*": "*",
},
has: true,
},
// Case 025
{
all: map[string]string{
"key": "val",
"one": "two",
"baz": "zap",
},
sub: map[string]string{
"key": "val",
"one": "two",
"baz": "zap",
"zap": "*",
},
has: false,
},
}

for i, tc := range testCases {
Expand Down

0 comments on commit b9dcece

Please sign in to comment.