-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michael Hoffmann <[email protected]>
- Loading branch information
1 parent
a59bd69
commit 77bd21b
Showing
7 changed files
with
4 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,9 +31,8 @@ func TestUserIsEmpty(t *testing.T) { | |
{input: User{IPAddress: "127.0.0.1"}, want: false}, | ||
{input: User{Username: "My Username"}, want: false}, | ||
{input: User{Name: "My Name"}, want: false}, | ||
{input: User{Segment: "My Segment"}, want: false}, | ||
{input: User{Data: map[string]string{"foo": "bar"}}, want: false}, | ||
{input: User{ID: "foo", Email: "[email protected]", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Segment: "My Segment", Data: map[string]string{"foo": "bar"}}, want: false}, | ||
{input: User{ID: "foo", Email: "[email protected]", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Data: map[string]string{"foo": "bar"}}, want: false}, | ||
} | ||
|
||
for _, test := range tests { | ||
|
@@ -52,7 +51,6 @@ func TestUserMarshalJson(t *testing.T) { | |
{input: User{IPAddress: "127.0.0.1"}, want: `{"ip_address":"127.0.0.1"}`}, | ||
{input: User{Username: "My Username"}, want: `{"username":"My Username"}`}, | ||
{input: User{Name: "My Name"}, want: `{"name":"My Name"}`}, | ||
{input: User{Segment: "My Segment"}, want: `{"segment":"My Segment"}`}, | ||
{input: User{Data: map[string]string{"foo": "bar"}}, want: `{"data":{"foo":"bar"}}`}, | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,9 +57,9 @@ func fillEventWithData(event *Event) *Event { | |
|
||
func TestScopeSetUser(t *testing.T) { | ||
scope := NewScope() | ||
scope.SetUser(User{ID: "foo", Email: "[email protected]", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Segment: "My Segment", Data: map[string]string{"foo": "bar"}}) | ||
scope.SetUser(User{ID: "foo", Email: "[email protected]", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Data: map[string]string{"foo": "bar"}}) | ||
|
||
assertEqual(t, User{ID: "foo", Email: "[email protected]", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Segment: "My Segment", Data: map[string]string{"foo": "bar"}}, scope.user) | ||
assertEqual(t, User{ID: "foo", Email: "[email protected]", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Data: map[string]string{"foo": "bar"}}, scope.user) | ||
} | ||
|
||
func TestScopeSetUserOverrides(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters