/
githubmirror
/
pop
Обзор
Документация
Войти
/
githubmirror
/
pop
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
dialect_test.go
34 строки
585 B
Mark Bates
Pop occasionally drops empty schema.sql files fixes #272 (#273)
20 окт 2018, 22:19
20 окт 2018, 22:19
75041f9
Код
Авторство
О чём код?
package pop import ( "bytes" "os/exec" "strings" "testing" "github.com/stretchr/testify/require" ) func Test_genericDumpSchema(t *testing.T) { table := []struct { cmd *exec.Cmd err bool }{ {exec.Command("ls"), false}, {exec.Command("asdfasdf"), true}, } for _, tt := range table { t.Run(strings.Join(tt.cmd.Args, " "), func(st *testing.T) { r := require.New(st) bb := &bytes.Buffer{} err := genericDumpSchema(&ConnectionDetails{}, tt.cmd, bb) if tt.err { r.Error(err) return } r.NoError(err) r.NotEqual(0, len(bb.Bytes())) }) } }