(t *testing.T)
| 99 | } |
| 100 | |
| 101 | func TestViewSubsetChat(t *testing.T) { |
| 102 | t.Parallel() |
| 103 | table := reflect.TypeOf(database.ChatTable{}) |
| 104 | joined := reflect.TypeOf(database.Chat{}) |
| 105 | |
| 106 | tableFields := allFields(table) |
| 107 | joinedFields := allFields(joined) |
| 108 | if !assert.Subset(t, fieldNames(joinedFields), fieldNames(tableFields), "table is not subset") { |
| 109 | t.Log("Some fields were added to the Chat Table without updating the 'chats_expanded' view.") |
| 110 | t.Log("See migration 000496_chat_database_foundation.up.sql to create the view.") |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | func fieldNames(fields []reflect.StructField) []string { |
| 115 | names := make([]string, len(fields)) |
nothing calls this directly
no test coverage detected