Remove subscription_stability_test.go and improve test variable naming
Some checks failed
Go / build-and-release (push) Has been cancelled
Some checks failed
Go / build-and-release (push) Has been cancelled
Deleted `subscription_stability_test.go` to clean up unused or redundant code. Updated naming in test files for improved readability, replacing `tag` with `tg` for consistency. Also updated the `github.com/klauspost/compress` dependency to v1.18.2.
This commit is contained in:
@@ -36,12 +36,12 @@ func TestKind3TagRoundTrip(t *testing.T) {
|
||||
|
||||
// Verify all tags have key "p"
|
||||
pTagCount := 0
|
||||
for _, tag := range *ev1.Tags {
|
||||
for _, tg := range *ev1.Tags {
|
||||
if tag != nil && tag.Len() >= 2 {
|
||||
key := tag.Key()
|
||||
key := tg.Key()
|
||||
if len(key) == 1 && key[0] == 'p' {
|
||||
pTagCount++
|
||||
t.Logf("Found p tag with value length: %d bytes", len(tag.Value()))
|
||||
t.Logf("Found p tag with value length: %d bytes", len(tg.Value()))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,12 +62,12 @@ func TestKind3TagRoundTrip(t *testing.T) {
|
||||
|
||||
// Verify all tags still have key "p"
|
||||
pTagCount2 := 0
|
||||
for _, tag := range *ev2.Tags {
|
||||
for _, tg := range *ev2.Tags {
|
||||
if tag != nil && tag.Len() >= 2 {
|
||||
key := tag.Key()
|
||||
key := tg.Key()
|
||||
if len(key) == 1 && key[0] == 'p' {
|
||||
pTagCount2++
|
||||
t.Logf("Found p tag after round-trip with value length: %d bytes", len(tag.Value()))
|
||||
t.Logf("Found p tag after round-trip with value length: %d bytes", len(tg.Value()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,8 +581,8 @@ func TestQueryEventsByTag(t *testing.T) {
|
||||
for _, ev := range events {
|
||||
if ev.Tags != nil && ev.Tags.Len() > 0 {
|
||||
// Find a tag with at least 2 elements and first element of length 1
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testTagEvent = ev
|
||||
break
|
||||
}
|
||||
@@ -600,9 +600,9 @@ func TestQueryEventsByTag(t *testing.T) {
|
||||
|
||||
// Get the first tag with at least 2 elements and first element of length 1
|
||||
var testTag *tag.T
|
||||
for _, tag := range *testTagEvent.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
testTag = tag
|
||||
for _, tg := range *testTagEvent.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testTag = tg
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -627,10 +627,10 @@ func TestQueryEventsByTag(t *testing.T) {
|
||||
// Verify all events have the tag
|
||||
for i, ev := range evs {
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
if utils.FastEqual(tag.Key(), testTag.Key()) &&
|
||||
utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(tg.Key(), testTag.Key()) &&
|
||||
utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ func TestQueryForAuthorsTags(t *testing.T) {
|
||||
if ev.Tags != nil && ev.Tags.Len() > 0 {
|
||||
// Find a tag with at least 2 elements and the first element of
|
||||
// length 1
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testEvent = ev
|
||||
break
|
||||
}
|
||||
@@ -115,9 +115,9 @@ func TestQueryForAuthorsTags(t *testing.T) {
|
||||
|
||||
// Get the first tag with at least 2 elements and first element of length 1
|
||||
var testTag *tag.T
|
||||
for _, tag := range *testEvent.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
testTag = tag
|
||||
for _, tg := range *testEvent.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testTag = tg
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -163,11 +163,11 @@ func TestQueryForAuthorsTags(t *testing.T) {
|
||||
|
||||
// Check if the event has the tag we're looking for
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(
|
||||
tag.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
tg.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
|
||||
@@ -172,8 +172,8 @@ func TestQueryForIds(t *testing.T) {
|
||||
for _, ev := range events {
|
||||
if ev.Tags != nil && ev.Tags.Len() > 0 {
|
||||
// Find a tag with at least 2 elements and first element of length 1
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testEvent = ev
|
||||
break
|
||||
}
|
||||
@@ -187,9 +187,9 @@ func TestQueryForIds(t *testing.T) {
|
||||
if testEvent != nil {
|
||||
// Get the first tag with at least 2 elements and first element of length 1
|
||||
var testTag *tag.T
|
||||
for _, tag := range *testEvent.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
testTag = tag
|
||||
for _, tg := range *testEvent.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testTag = tg
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -221,11 +221,11 @@ func TestQueryForIds(t *testing.T) {
|
||||
|
||||
// Check if the event has the tag we're looking for
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(
|
||||
tag.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
tg.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
@@ -325,11 +325,11 @@ func TestQueryForIds(t *testing.T) {
|
||||
|
||||
// Check if the event has the tag we're looking for
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(
|
||||
tag.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
tg.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
@@ -393,11 +393,11 @@ func TestQueryForIds(t *testing.T) {
|
||||
|
||||
// Check if the event has the tag we're looking for
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(
|
||||
tag.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
tg.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
@@ -454,11 +454,11 @@ func TestQueryForIds(t *testing.T) {
|
||||
|
||||
// Check if the event has the tag we're looking for
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(
|
||||
tag.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
tg.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ func TestQueryForKindsAuthorsTags(t *testing.T) {
|
||||
for _, ev := range events {
|
||||
if ev.Tags != nil && ev.Tags.Len() > 0 {
|
||||
// Find a tag with at least 2 elements and first element of length 1
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testEvent = ev
|
||||
break
|
||||
}
|
||||
@@ -115,9 +115,9 @@ func TestQueryForKindsAuthorsTags(t *testing.T) {
|
||||
|
||||
// Get the first tag with at least 2 elements and first element of length 1
|
||||
var testTag *tag.T
|
||||
for _, tag := range *testEvent.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
testTag = tag
|
||||
for _, tg := range *testEvent.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testTag = tg
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -174,11 +174,11 @@ func TestQueryForKindsAuthorsTags(t *testing.T) {
|
||||
|
||||
// Check if the event has the tag we're looking for
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(
|
||||
tag.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
tg.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ func TestQueryForKindsTags(t *testing.T) {
|
||||
for _, ev := range events {
|
||||
if ev.Tags != nil && ev.Tags.Len() > 0 {
|
||||
// Find a tag with at least 2 elements and first element of length 1
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testEvent = ev
|
||||
break
|
||||
}
|
||||
@@ -115,9 +115,9 @@ func TestQueryForKindsTags(t *testing.T) {
|
||||
|
||||
// Get the first tag with at least 2 elements and first element of length 1
|
||||
var testTag *tag.T
|
||||
for _, tag := range *testEvent.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
testTag = tag
|
||||
for _, tg := range *testEvent.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testTag = tg
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -163,11 +163,11 @@ func TestQueryForKindsTags(t *testing.T) {
|
||||
|
||||
// Check if the event has the tag we're looking for
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(
|
||||
tag.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
tg.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
|
||||
@@ -92,8 +92,8 @@ func TestQueryForTags(t *testing.T) {
|
||||
for _, ev := range events {
|
||||
if ev.Tags != nil && ev.Tags.Len() > 0 {
|
||||
// Find a tag with at least 2 elements and first element of length 1
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testEvent = ev
|
||||
break
|
||||
}
|
||||
@@ -110,9 +110,9 @@ func TestQueryForTags(t *testing.T) {
|
||||
|
||||
// Get the first tag with at least 2 elements and first element of length 1
|
||||
var testTag *tag.T
|
||||
for _, tag := range *testEvent.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
testTag = tag
|
||||
for _, tg := range *testEvent.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
testTag = tg
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -147,11 +147,11 @@ func TestQueryForTags(t *testing.T) {
|
||||
|
||||
// Check if the event has the tag we're looking for
|
||||
var hasTag bool
|
||||
for _, tag := range *ev.Tags {
|
||||
if tag.Len() >= 2 && len(tag.Key()) == 1 {
|
||||
for _, tg := range *ev.Tags {
|
||||
if tg.Len() >= 2 && len(tg.Key()) == 1 {
|
||||
if utils.FastEqual(
|
||||
tag.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tag.Value(), testTag.Value()) {
|
||||
tg.Key(), testTag.Key(),
|
||||
) && utils.FastEqual(tg.Value(), testTag.Value()) {
|
||||
hasTag = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user