mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-09 09:49:09 +02:00
test: skip networked tests if no connection (#661)
* test: skip networked tests if no connection * fix: handle unexpected http responses * fix: return if a valid URL is generated * test: delete networked test
This commit is contained in:
parent
f255f3a603
commit
7b3bfac306
1 changed files with 0 additions and 24 deletions
24
glow_test.go
24
glow_test.go
|
|
@ -1,33 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGlowSources(t *testing.T) {
|
||||
tt := []string{
|
||||
".",
|
||||
"README.md",
|
||||
"github.com/charmbracelet/glow",
|
||||
"github://charmbracelet/glow",
|
||||
"https://github.com/charmbracelet/glow",
|
||||
}
|
||||
|
||||
for _, v := range tt {
|
||||
t.Run(v, func(t *testing.T) {
|
||||
buf := &bytes.Buffer{}
|
||||
err := executeArg(rootCmd, v, buf)
|
||||
if err != nil {
|
||||
t.Errorf("Error during execution (args: %s): %v", v, err)
|
||||
}
|
||||
if buf.Len() == 0 {
|
||||
t.Errorf("Output buffer should not be empty (args: %s)", v)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGlowFlags(t *testing.T) {
|
||||
tt := []struct {
|
||||
args []string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue