Skip to content

Commit 09bffe8

Browse files
committed
misc cleanup
1 parent 9c61ab4 commit 09bffe8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ldservices/client_sdk_data_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"gopkg.in/launchdarkly/go-sdk-common.v1/ldvalue"
88

9+
"github.com/launchdarkly/eventsource"
910
"github.com/stretchr/testify/assert"
1011
)
1112

@@ -16,6 +17,10 @@ func TestFlagValuePatchEvent(t *testing.T) {
1617
expectedJSON1 := `{"key": "flagkey", "version": 1, "flagVersion": 1000, "value": true, "variation": 1}`
1718
assertJSONEqual(t, expectedJSON1, string(bytes1))
1819

20+
var event eventsource.Event = f
21+
assert.Equal(t, "patch", event.Event())
22+
assert.Equal(t, string(bytes1), event.Data())
23+
1924
bytes2 := f.ToJSON(false)
2025
expectedJSON2 := `{"version": 1, "flagVersion": 1000, "value": true, "variation": 1}`
2126
assertJSONEqual(t, expectedJSON2, string(bytes2))

ldservices/server_sdk_data.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ func (f fakeFlagOrSegment) GetKey() string {
2020

2121
// FlagOrSegment provides a stub implementation of KeyedData that has only "key" and "version" properties.
2222
// This may be enough for some testing purposes that don't require full flag or segment data.
23-
//
24-
// It also implements the eventsource.Event interface, simulating a "patch" event for the streaming service.
2523
func FlagOrSegment(key string, version int) KeyedData {
2624
return fakeFlagOrSegment{Key: key, Version: version}
2725
}

0 commit comments

Comments
 (0)