Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions llx/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,13 @@ func ComparableLabel(label string) (string, bool) {
}
}

if len(label)-start >= 2 {
x := label[start : start+2]
if _, ok := comparableOperations[x]; ok {
return x, true
}
}

x := label[start : start+1]
if _, ok := comparableOperations[x]; ok {
return x, true
Expand All @@ -565,11 +572,6 @@ func ComparableLabel(label string) (string, bool) {
return "", false
}

x = label[start : start+2]
if _, ok := comparableOperations[x]; ok {
return x, true
}

return "", false
}

Expand Down
32 changes: 32 additions & 0 deletions mqlc/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,38 @@ func TestLabels(t *testing.T) {
},
},
},
{
"1 >= 2",
&llx.Labels{
Labels: map[string]string{
"KN8O7dRC1dktiemLwSo3kqNRIwRf5jXqEqPsa2O7bgs31z7LM3fxYrm6tOCyzYAC7Jpic3q6CUYbbYtn7yaifQ==": " >= 2",
},
},
},
{
"1 > 2",
&llx.Labels{
Labels: map[string]string{
"hPdqqG1LQ4F3OnnS3gey0/665f+p0XLMoOVCTUScM/pMQuothxnwd0TyuzQOIPn3fkpf+kTtxZNgi0y688AN9Q==": " > 2",
},
},
},
{
"1 <= 2",
&llx.Labels{
Labels: map[string]string{
"JxA4wNPJRq2CsRwXpkvnx7leIVGoeg1e8s3En5Aize9mdZoPD7GpLb9JG86dh30DzdgncT+Hgm87nZehVdgw2w==": " <= 2",
},
},
},
{
"1 < 2",
&llx.Labels{
Labels: map[string]string{
"PaamyN/AAZNMNmh4OAzjmG/ArLYReuNzi4p2KyDyDE/CZw+puUX0A2oCV8aHh+QJvF5o/4TfjvL+vCmb7Ge9KA==": " < 2",
},
},
},
}

for i := range tests {
Expand Down
Loading