summaryrefslogtreecommitdiff
path: root/internal/types
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-09-12 10:33:11 +0300
committerPaul Buetow <paul@buetow.org>2024-09-12 10:33:11 +0300
commit0b15a3b786bce10c112655fddbb4cc5b74e7a0d3 (patch)
tree79a45861ad9faedb51b2a89994206aa57b7521ce /internal/types
parent8d88383d769afbfb50e5dfdb559713e075481a43 (diff)
refactor a bit
Diffstat (limited to 'internal/types')
-rw-r--r--internal/types/entry.go1
-rw-r--r--internal/types/entry_test.go18
2 files changed, 9 insertions, 10 deletions
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 }
}
}
`