diff --git a/core/channel_test.go b/core/channel_test.go index 2cc3b09..e6bfd77 100644 --- a/core/channel_test.go +++ b/core/channel_test.go @@ -36,7 +36,7 @@ func TestChannel(t *testing.T) { if err != nil { t.Fatalf("failed to get sources in channel: %v", err) } - if len(sources) != 1 || sources["channel"][0] != "two" { + if len(sources["channel"]) != 1 || sources["channel"][0] != "two" { t.Fatalf("unexpected sources in channel after deletion: %v", sources) } if err := AddSourceToChannel(db, "channel", "one"); err != nil { diff --git a/core/db_test.go b/core/db_test.go index e8d31b5..b526d73 100644 --- a/core/db_test.go +++ b/core/db_test.go @@ -104,7 +104,7 @@ func TestDeleteSourceCascade(t *testing.T) { t.Fatalf("failed to get active items: %v", err) } if len(items) != 2 { - t.Fatal("Expected 2 items") + t.Fatalf("Expected 2 items, got %d", len(items)) } if err := DeleteSource(db, "source1"); err != nil { diff --git a/core/sql/0001_initial_schema.sql b/core/sql/0001_initial_schema.sql index 4fbf2a9..f604253 100644 --- a/core/sql/0001_initial_schema.sql +++ b/core/sql/0001_initial_schema.sql @@ -52,10 +52,10 @@ create table sessions( ) strict; -- user introduction -insert into sources (name) values ('default'); -insert into channels (name, source) values ('home', 'default'); -insert into actions (source, name, argv) values ('default', 'fetch', jsonb('["true"]')); -insert into items (source, id, active, title, author, body, link, time, ttl, ttd, tts, action) - values ('default', 'welcome', 1, 'Welcome to intake!', 'intake', - '

Click the "X" button on this item to deactivate it and hide it from the feed.

', - '', 1, 0, 0, 0, jsonb('null')) +-- insert into sources (name) values ('default'); +-- insert into channels (name, source) values ('home', 'default'); +-- insert into actions (source, name, argv) values ('default', 'fetch', jsonb('["true"]')); +-- insert into items (source, id, active, title, author, body, link, time, ttl, ttd, tts, action) +-- values ('default', 'welcome', 1, 'Welcome to intake!', 'intake', +-- '

Click the "X" button on this item to deactivate it and hide it from the feed.

', +-- '', 1, 0, 0, 0, jsonb('null'))