zenity/dialog/dialog_test.go

56 lines
1,022 B
Go
Raw Normal View History

2019-12-11 05:29:31 -05:00
package dialog
import "testing"
func TestOpenFile(t *testing.T) {
ret, err := OpenFile("", "", []FileFilter{
{"Go files", []string{".go"}},
{"Web files", []string{".html", ".js", ".css"}},
{"Image files", []string{".png", ".ico"}},
})
if err != nil {
t.Error(err)
} else {
t.Logf("%#v", ret)
}
}
func TestOpenFiles(t *testing.T) {
ret, err := OpenFiles("", "", []FileFilter{
{"Go files", []string{".go"}},
{"Web files", []string{".html", ".js", ".css"}},
{"Image files", []string{".png", ".ico"}},
})
if err != nil {
t.Error(err)
} else {
t.Logf("%#v", ret)
}
}
func TestSaveFile(t *testing.T) {
2019-12-11 06:29:32 -05:00
ret, err := SaveFile("", "", true, []FileFilter{
2019-12-11 05:29:31 -05:00
{"Go files", []string{".go"}},
{"Web files", []string{".html", ".js", ".css"}},
{"Image files", []string{".png", ".ico"}},
})
if err != nil {
t.Error(err)
} else {
t.Logf("%#v", ret)
}
}
func TestPickFolder(t *testing.T) {
ret, err := PickFolder("", "")
if err != nil {
t.Error(err)
} else {
t.Logf("%#v", ret)
}
}