diff options
Diffstat (limited to 'schema/schema_test.go')
| -rw-r--r-- | schema/schema_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/schema/schema_test.go b/schema/schema_test.go index aee2452..5dc00d1 100644 --- a/schema/schema_test.go +++ b/schema/schema_test.go @@ -114,3 +114,33 @@ func TestYoutubeFeed(t *testing.T) { } } +func TestEntryDescContains(t *testing.T) { + var testMatrix = []struct { + name string + entry Entry + contains string + expected bool + }{ + { + name: "t1", + entry: Entry{ + Desc: "iPhone 1 through 17 generation takes the same photo", + }, + contains: "iPhone", + expected: true, + }, + { + name: "t2", + entry: Entry{ + Desc: "iPhone 1 through 17 generation takes the same photo", + }, + contains: "iPhone 17", + expected: false, + }, + } + for _, tc := range testMatrix { + if tc.entry.DescContains(tc.contains) != tc.expected { + t.Errorf("%s: expected %v, got %v", tc.name, tc.expected, !tc.expected) + } + } +} |
