From 0b15a3b786bce10c112655fddbb4cc5b74e7a0d3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 12 Sep 2024 10:33:11 +0300 Subject: refactor a bit --- internal/types/entry.go | 1 - internal/types/entry_test.go | 18 +++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'internal/types') diff --git a/internal/types/entry.go b/internal/types/entry.go index 9f3531a..f17c06a 100644 --- a/internal/types/entry.go +++ b/internal/types/entry.go @@ -10,7 +10,6 @@ import ( "strings" ) -type PlatformName = string type EntryID = string type Epoch = int diff --git a/internal/types/entry_test.go b/internal/types/entry_test.go index 3dde570..40f0955 100644 --- a/internal/types/entry_test.go +++ b/internal/types/entry_test.go @@ -15,11 +15,11 @@ func TestNewEntryFromJSON(t *testing.T) { if len(entry1.Shared) != 2 { t.Error("expected to have two shared entries in entry1") } - if !entry1.IsShared("Foo") { - t.Error("Foo should be shared") + if !entry1.IsShared("Mastodon") { + t.Error("Mastodon should be shared") } - if entry1.IsShared("Bar") { - t.Error("Bar should not be shared") + if entry1.IsShared("LinkedIn") { + t.Error("LinkedIn should not be shared") } } @@ -114,8 +114,8 @@ func oneEntry() (Entry, error) { { "body": "Body text here", "shared": { - "Foo": { "is": true }, - "Bar": { "is": false } + "Mastodon": { "is": true }, + "LinkedIn": { "is": false } } } ` @@ -127,9 +127,9 @@ func anotherEntry() (Entry, error) { { "body": "Body text here", "shared": { - "Foo": { "is": true }, - "Bar": { "is": true }, - "Baz": { "is": false } + "Mastodon": { "is": true }, + "LinkedIn": { "is": true }, + "Textfile": { "is": false } } } ` -- cgit v1.2.3