Skip to content

Commit aef4504

Browse files
committed
fix tests and Travis CI config
1 parent c4b625a commit aef4504

File tree

7 files changed

+31
-1
lines changed

7 files changed

+31
-1
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ language: go
44
go:
55
- 1.x
66
- tip
7+
8+
script: make test

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build:
55

66
test: all
77
go test -tags=online ./...
8-
./test.sh
8+
./e2e.sh
99

1010
install:
1111
@go install

test.sh renamed to e2e.sh

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ for given in testdata/*_modules.txt; do
1010

1111
./modules2tuple ${given} > ${actual}
1212
diff -u ${expected} ${actual}
13+
rm ${actual}
1314
done

parser/parser_offline_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// +build !online
2+
3+
package parser
4+
5+
import "github.com/dmgk/modules2tuple/config"
6+
7+
func init() {
8+
config.Offline = true
9+
}

parser/parser_online_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ package parser
55
import (
66
"strings"
77
"testing"
8+
9+
"github.com/dmgk/modules2tuple/config"
810
)
911

12+
func init() {
13+
config.Offline = false
14+
}
15+
1016
func TestUniqueProjectAndTag(t *testing.T) {
1117
given := `
1218
# github.com/json-iterator/go v1.1.7

tuple/resolver_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ package tuple
33
import (
44
"fmt"
55
"testing"
6+
7+
"github.com/dmgk/modules2tuple/config"
68
)
79

10+
func init() {
11+
config.Offline = true
12+
}
13+
814
type resolverExample struct {
915
pkg string
1016
source Source

tuple/tuple_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ package tuple
33
import (
44
"strings"
55
"testing"
6+
7+
"github.com/dmgk/modules2tuple/config"
68
)
79

10+
func init() {
11+
config.Offline = true
12+
}
13+
814
func TestParseRegularSpec(t *testing.T) {
915
examples := [][]string{
1016
// spec, expected package, expected version

0 commit comments

Comments
 (0)